DrCheese1023
New Member
- Joined
- Jun 28, 2021
- Messages
- 10
- Office Version
- 2019
- Platform
- Windows
Here is my code, first off:
This worked for what I needed at the time, but how can I adjust this to not only look through specified sheets, but every single sheet on a workbook? I dont want to manually add to the code every time i change my sheets.
Crossposted @ How can I use Application.XLookup across every sheet in my workbook?
VBA Code:
Sub namelookup()
SalesForm.BHSDTAPNAMELF.Value = Application.XLookup(Val(SalesForm.BHSDMAINNUMBERLF.Value), Worksheets("NICK TAPS").Range("S:S"), Worksheets("NICK TAPS").Range("T:T"), Application.XLookup(Val(SalesForm.BHSDMAINNUMBERLF.Value), Worksheets("CB TAPS").Range("S:S"), Worksheets("CB TAPS").Range("T:T"), Application.XLookup(Val(SalesForm.BHSDMAINNUMBERLF.Value), Worksheets("GG TAPS").Range("S:S"), Worksheets("GG TAPS").Range("T:T"))))
End Sub
This worked for what I needed at the time, but how can I adjust this to not only look through specified sheets, but every single sheet on a workbook? I dont want to manually add to the code every time i change my sheets.
Crossposted @ How can I use Application.XLookup across every sheet in my workbook?