Hello guys,
Please help on below simple macro.
MACRO selects columns and changes specific texts with news
Always B39, B40, B41, B42, B43 changes with the Column ID.
ie: Column name is C, so text will be changed to C39, C40, C41, C42, C43.
Since I have lots of columns like starting with C thru DB so I need some macro to make it happen easier?
Any help will be appreciated.
Please help on below simple macro.
MACRO selects columns and changes specific texts with news
Always B39, B40, B41, B42, B43 changes with the Column ID.
ie: Column name is C, so text will be changed to C39, C40, C41, C42, C43.
Since I have lots of columns like starting with C thru DB so I need some macro to make it happen easier?
Any help will be appreciated.
Code:
Sub Macro2()
'
' Macro2 Macro
'
'
Range("D38:D43").Select
Selection.Replace What:="B39", Replacement:="D39", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="B40", Replacement:="D40", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="B41", Replacement:="D41", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="B42", Replacement:="D42", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="B43", Replacement:="D43", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("E38:E43").Select
Selection.Replace What:="B39", Replacement:="E39", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="B40", Replacement:="E40", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="B41", Replacement:="E41", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="B42", Replacement:="E42", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="B43", Replacement:="E43", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub
Last edited: