×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Find and Replace with wildcards

Find and Replace with wildcards

Find and Replace with wildcards

(OP)
I have a simple task of adding the number zero "0" infront of a long list of labels (text) in excel.  The example is as follows:

5AAA5 --> 05AAA5
5BBB5 --> 05BBB5
5CCC5 --> 05CCC5

Of course I can do a simple find and replace for the number '5' but I don't want to replace the last 5 in the series.  I can also do a find and replace for '5????' but when I put '05???' in the replace box it replaces everything with ???.  Any ideas?  Got a macro to do this?

Thanks for your help in advance, Mark

RE: Find and Replace with wildcards

="0" & A1 [or the cell that contains your data]

RE: Find and Replace with wildcards

Don't use find and replace.  Use string manipulation functions in VBA instead.



RE: Find and Replace with wildcards

You could create a custom format to avoid having to create a new column on your sheet.

Select all cells you want to change, select format >> cells >> custom and enter 0#;0#;;"0"@

RE: Find and Replace with wildcards

(OP)
Thanks everyone for their responses.  To make life simple I took Melone's '="0" & A1' and then did a copy / paste as value back over the old values.  Done deal.

Thanks again, Mark

RE: Find and Replace with wildcards

OK, I am posting this suggestion after you already found a workable solution, but I am going to post my standard answer to so many of these requests:

Install a free copy of ASAP Utilities from www.asap-utilities.com

This brilliant free Excel plug-in has dozens (hundreds?) of useful add-in tools, including "ASAP Utilities | Text | Insert before current value". Simply select the block you are interested in, find the appropriate ASAP Utility, enter the character(s) you want to insert, and click on OK. Done!

Hope this helps!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources