Help Please,
I know this has been answered a number of times already, but I don’t know enough <acronym title="visual basic for applications">VBA</acronym> to interpret the code and manipulate it to meet my specific needs. Basically, I need to update old account information with new account information by doing a find and replace. The problem is, I have a bunch of items I need to ‘replace’, so I’d like a macro with a loop to search for old account numbers (the list of account numbers to search is listed in column C) that are in Column A and replace the old account numbers in Column A with the new account numbers found in Column E. There are 270 account numbers to search. Here’s the macro I have; however, it doesn’t work:
Sub FindReplace()
'
' FindReplace Macro
'
'
Range("D1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, -1).Range("A1").Select
Selection.Copy
Range("F1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, -1).Range("A1").Select
Application.CutCopyMode = False
Selection.Copy
Columns("A:A").Select
Selection.Replace What:="Acct_814E", Replacement:="Acct_814E1", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("D1").Select
Selection.End(xlDown).Select
Application.CutCopyMode = False
Selection.Copy
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(0, 2).Range("A1").Select
ActiveSheet.Paste
End Sub
Let me know if you have any questions.
Thank you.
I know this has been answered a number of times already, but I don’t know enough <acronym title="visual basic for applications">VBA</acronym> to interpret the code and manipulate it to meet my specific needs. Basically, I need to update old account information with new account information by doing a find and replace. The problem is, I have a bunch of items I need to ‘replace’, so I’d like a macro with a loop to search for old account numbers (the list of account numbers to search is listed in column C) that are in Column A and replace the old account numbers in Column A with the new account numbers found in Column E. There are 270 account numbers to search. Here’s the macro I have; however, it doesn’t work:
Sub FindReplace()
'
' FindReplace Macro
'
'
Range("D1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, -1).Range("A1").Select
Selection.Copy
Range("F1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, -1).Range("A1").Select
Application.CutCopyMode = False
Selection.Copy
Columns("A:A").Select
Selection.Replace What:="Acct_814E", Replacement:="Acct_814E1", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("D1").Select
Selection.End(xlDown).Select
Application.CutCopyMode = False
Selection.Copy
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(0, 2).Range("A1").Select
ActiveSheet.Paste
End Sub
Let me know if you have any questions.
Thank you.