D delta Member May 11, 2018 #1 what is wrong in vlookup macro TB2.Value = Application.WorksheetFunction.VLookup(TB1, Worksheets("BAZE").Range("K3:N10"), 2, 0) TB3.Value = Application.WorksheetFunction.VLookup(TB1, Worksheets("BAZE").Range("K3:N10"), 3, 0) Attachments FORM - Copy (2).xlsm 25.6 KB · Views: 8
what is wrong in vlookup macro TB2.Value = Application.WorksheetFunction.VLookup(TB1, Worksheets("BAZE").Range("K3:N10"), 2, 0) TB3.Value = Application.WorksheetFunction.VLookup(TB1, Worksheets("BAZE").Range("K3:N10"), 3, 0)
Marc L Excel Ninja May 11, 2018 #2 Do not use WorksheetFunction but just Application ! Like Application.VLookup … And compare with a cell formula.
Do not use WorksheetFunction but just Application ! Like Application.VLookup … And compare with a cell formula.
Marc L Excel Ninja May 11, 2018 #4 The reason why WorksheetFunction crashes ! So first try a VLookup formula directly in a cell on Excel side … As if it can't work in Excel, it can't work under VBA !
The reason why WorksheetFunction crashes ! So first try a VLookup formula directly in a cell on Excel side … As if it can't work in Excel, it can't work under VBA !
Chihiro Excel Ninja May 11, 2018 #5 TB1 is object... you can't use TB1 as Lookup_Value. Also, remember that Textbox & Combobox stores value as text only. So you should convert it to numeric value before using it in VLOOKUP. Ex. Code: TB2.Value = Application.VLookup(CLng(TB1.Value), Worksheets("BAZE").Range("K3:N10"), 2, 0)
TB1 is object... you can't use TB1 as Lookup_Value. Also, remember that Textbox & Combobox stores value as text only. So you should convert it to numeric value before using it in VLOOKUP. Ex. Code: TB2.Value = Application.VLookup(CLng(TB1.Value), Worksheets("BAZE").Range("K3:N10"), 2, 0)
N NARAYANK991 Excel Ninja May 12, 2018 #7 Hi , See if this works. Narayan Attachments Test.xlsm 23.2 KB · Views: 11