M4RSHMAN85
New Member
- Joined
- Feb 25, 2023
- Messages
- 4
- Office Version
- 2019
- Platform
- Windows
Hi All,
Currently working through creating some invoice automation and I've run in to a spot with locate the customers address based on a variable name. Here is what I've come up with so far. Any help would be great - Thank you.
Sub Macro5()
'
' Macro5 Macro
'
'Get Name'
Windows("BOOKS.xlsm").Activate
Range("B3").Select
Selection.End(xlDown).Select
Selection.Copy
'Paste Name'
Windows("Invoice Template.xlsx").Activate
Range("B7:C7").Select
ActiveSheet.Paste
Application.CutCopyMode = False
'Copy Name'
Selection.Copy
'Go To addresses sheet'
Sheets("Invoice Address Book").Select
*****'Find Selection Contents'*****
*****'RANGE IS B3:BA100'*****
Cells.Find(What:="******", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
'Copy Address'
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
'Paste Address'
Sheets("Invoice").Select
ActiveSheet.Paste
'Select Name & End'
Range("B7:C7").Select
End Sub
Currently working through creating some invoice automation and I've run in to a spot with locate the customers address based on a variable name. Here is what I've come up with so far. Any help would be great - Thank you.
Sub Macro5()
'
' Macro5 Macro
'
'Get Name'
Windows("BOOKS.xlsm").Activate
Range("B3").Select
Selection.End(xlDown).Select
Selection.Copy
'Paste Name'
Windows("Invoice Template.xlsx").Activate
Range("B7:C7").Select
ActiveSheet.Paste
Application.CutCopyMode = False
'Copy Name'
Selection.Copy
'Go To addresses sheet'
Sheets("Invoice Address Book").Select
*****'Find Selection Contents'*****
*****'RANGE IS B3:BA100'*****
Cells.Find(What:="******", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
'Copy Address'
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
'Paste Address'
Sheets("Invoice").Select
ActiveSheet.Paste
'Select Name & End'
Range("B7:C7").Select
End Sub