Hi, I have an excel worksheet in a given workbook and i need to replace several text strings with new text strings which i have now defined as "named ranges".
So i have in the formulas something like this................ "texttoreplace"...........
basically text with quoest around it.
I want to replace this text with DefnName1 where DefnName1 = "texttoreplace"
I did record a macro and here is what i got
Cells.Find(What:= _
"""texttoreplace""", After _
:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:= _
xlByColumns, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:= _
False).Activate
ActiveCell.Replace What:= _
"""texttroreplace""", _
Replacement:="DefnName1", LookAt _
:=xlPart, SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:= _
False, ReplaceFormat:=False
Cells.FindNext(After:=ActiveCell).Activate
But i am not sure how to really incorporate this into my code. I have a list/array of text i wish to replace and an array / list of text i wish to insert in its place.
What i was hoping for is to search a given worksheet and then replace the text with my new defnd name.
Any ideas?
I have like over 200 of these to do this is why i am looking at a macro instead of doing it manually.
Bookmarks