Multiple Edit Replaces

  • Thread starter Thread starter snax500
  • Start date Start date
S

snax500

In Excel2000, I need to write a macro that will edit replace many
strings. We changed our account string and I need to replace at least
100 different strings. For example, 2010 becomes 4010, 3526 becomes
5513. I have about 100 of these changes that I want to put into a
macro so that when I run it in any workbook it makes all of these
changes Do I just keep using Edit-Replace or do I use Case . What is
the best way of doing this?

Thanks
 
Edit - replace going through you list of replacements. Insure your
replacements are made so the string being replaced remains unique.


You can get the replace code using the macro recorder.
 
maybe u need not VBA ,u can enter a number that u want to plus(i.e.2000) in
a cell ,then COPY it->select the range ,choose PASTE SPECIAL-->PLUS
that is all u can get it.

another for the vba code ,
Sub test4()
Dim mycell As Range
Application.ScreenUpdating = False
For Each mycell In ActiveSheet.UsedRange
mycell = mycell + 2000 'change as u shd plus number
Next mycell
Application.ScreenUpdating = True
End Sub


Hope this can be helpful
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top