replacing multiple strings
Posted by kev on March 16, 2001 8:01 AM
Hey, I need to go through 10,000 entries in a spreadsheet doing a find and replace on about 100 strings, and would love to have a macro to handle this. I looked up an earlier post on the board and found something similar to this:
Sub Replace_name()
Dim RowNum As Integer
Dim LastRow As Integer
With Worksheets("Replace")
LastRow = .UsedRange.Rows.Count
For RowNum = LastRow To 1 Step -1
If Range("A" & RowNum) = " Mug" Then
Range("A" & RowNum) = ""
End If
Next RowNum
End With
End Sub
but am unsure how to modify it to my needs. 1) How do I modify to at least replace 1 string like the above? 2) Can I do multiple replaces by repeating the If-End If statement with different strings?
Thanks for your help.