Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find & Replace macro limit?
How do I do what youre suggesting?
"Gary''s Student" wrote: As coded it works. But you need only one Search. Put it in a loop and put the strings into a string array. -- Gary's Student "RS" wrote: Im working in Excel 2000 and want to know if there is a limit on the number of items you can put in a Find & Replace macro. I have a spreadsheet that I import that has different names appearing at various places within a column and I want to replace those names in one step with items in my macro. I was editing a Find & Replace macro to include more than one item at a time, but after I entered 13 items, anything else I added turned a red color. Here is the code I am working on: Sub ComboTest() ' ' ComboTest Macro ' ' Cells.Replace What:="Boulder*", Replacement:=" Boulder", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Cells.Replace What:="Boston Area Net-Service", Replacement:="BANS", _ LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False Cells.Replace What:="Colorado*", Replacement:="CBCS", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Cells.Replace What:="CRP*", Replacement:="CRP", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Cells.Replace What:="California Case*", Replacement:="Cal Case", LookAt:= _ xlPart, SearchOrder:=xlByRows, MatchCase:=False Cells.Replace What:="Dallas*", Replacement:=" Dallas", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Cells.Replace What:="East Texas ARC", Replacement:="ETARC", LookAt:= _ xlPart, SearchOrder:=xlByRows, MatchCase:=False Cells.Replace What:="ENACT INC", Replacement:="Enact", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Cells.Replace What:="Great Falls*", Replacement:="GF", LookAt:= _ xlPart, SearchOrder:=xlByRows, MatchCase:=False Cells.Replace What:="Harbor*", Replacement:="Harbor", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Cells.Replace What:="Las Vegas*", Replacement:=" Las Vegas ", LookAt:=xlPart _ , SearchOrder:=xlByRows, MatchCase:=False Cells.Replace What:="Sacramento*", Replacement:=" Sacramento", LookAt:= _ xlPart, SearchOrder:=xlByRows, MatchCase:=False Cells.Replace What:="Washington*", Replacement:="Washington", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False End Sub As I mentioned before, trying to add any more Replace items causes the new lines of code to turn red. Is there a way around this apparent limit? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find & Replace - Limit search to a specific column | Excel Worksheet Functions | |||
Find & Replace macro limit? | Excel Programming | |||
Using Find and Replace to replace " in a macro | Excel Programming | |||
find&replace macro | Excel Worksheet Functions | |||
Help with find and replace macro | Excel Programming |