Hello,
I do not have experience with VBA that's why I'm asking for your help with the following macro. I work on a daily basis with spreadsheets in excel. The number of columns is the same, but every single spreadsheet has a different number of rows. I recorded this macro in a table with 1196 rows and I would like to use this macro also in other tables with a different number of rows. I would be more than grateful if you could help me with this issue. Thank you.
Sub City2()
'
' City2 Macro
'
'
Selection.Copy
Cells.Replace What:="POMPANO", Replacement:="Pompano Beach", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B1195").Select
Application.CutCopyMode = False
Selection.Copy
Cells.Replace What:="COCOCRK", Replacement:="Coconut Creek", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B1193").Select
Application.CutCopyMode = False
Selection.Copy
Cells.Replace What:="MARGATE", Replacement:="Margate", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B1192").Select
Application.CutCopyMode = False
Selection.Copy
Cells.Replace What:="OAKPARK", Replacement:="Oakland Park", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B1190").Select
Application.CutCopyMode = False
Selection.Copy
Cells.Replace What:="DEERFLD", Replacement:="Deerfield Beach", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B1187").Select
Application.CutCopyMode = False
Selection.Copy
Cells.Replace What:="TAMARAC", Replacement:="Tamarac", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B1175").Select
Application.CutCopyMode = False
Selection.Copy
Cells.Replace What:="NLAUDER", Replacement:="North Lauderdale", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B1151").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Cells.Replace What:="LAUDLAKE", Replacement:="Lauderdale Lakes", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B1036").Select
Application.CutCopyMode = False
Selection.Copy
Cells.Replace What:="CORALSPR", Replacement:="Coral Springs", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B963").Select
Application.CutCopyMode = False
Selection.Copy
Cells.Replace What:="FORTLAUD", Replacement:="Fort Lauderdale", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B897").Select
Application.CutCopyMode = False
Selection.Copy
Cells.Replace What:="SUNRISE", Replacement:="Sunrise", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B866").Select
Application.CutCopyMode = False
Selection.Copy
Cells.Replace What:="LAUDHILL", Replacement:="Lauderhill", LookAt:=xlPart _
, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B710").Select
Application.CutCopyMode = False
Selection.Copy
Cells.Replace What:="LHPOINT", Replacement:="Lighthouse Point", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B680").Select
Application.CutCopyMode = False
Selection.Copy
Cells.Replace What:="LAUDBSEA", Replacement:="Lauderdale by the Sea", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:= _
False, ReplaceFormat:=False
Range("B359").Select
Columns("B:B").ColumnWidth = 20.86
Range("B290").Select
Application.CutCopyMode = False
Selection.Copy
Cells.Replace What:="PARKLAND", Replacement:="Parkland", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B177").Select
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Cells.Replace What:="SEARANCH", Replacement:="Sea Ranch Lakes", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B17").Select
Selection.Copy
Cells.Replace What:="HILLSBRO", Replacement:="Hillsboro Beach", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("B1").Select
End Sub
Bookmarks