rotonl
Mechanical
- May 26, 2004
- 2
I'm new to VBA and i'm trying to write a vlookup function to search different sheets when given information and what sheet to look on. the code i have so far is for a command button:
Dim Sheet as String
Dim Price as Double
Dim OD as Double
Price1 = WorksheetFunction.VLookup(OD, Sheets(Sheet).Range("A12:J39"), 10, False)
i seems from looking at other threads that i need to reference an object of somekind and put it after the equals sign and before the rest of the formula. My problem is i have no idea what needs to be referenced. Does and anyone have any ideas?
Dim Sheet as String
Dim Price as Double
Dim OD as Double
Price1 = WorksheetFunction.VLookup(OD, Sheets(Sheet).Range("A12:J39"), 10, False)
i seems from looking at other threads that i need to reference an object of somekind and put it after the equals sign and before the rest of the formula. My problem is i have no idea what needs to be referenced. Does and anyone have any ideas?