G
GregJG
i figured this code would work, i've broken it down for easy view
label15.Caption =
Application.WorksheetFunction.Sum(
Application.WorksheetFunction.VLookup(label12.Caption
Workbooks("1.xls").Sheets("1").Range("a3:b25"), 2, False)
+
Application.WorksheetFunction.VLookup(label13.Caption
Workbooks("2.xls").Sheets("1").Range("a3:b25"), 2, False)
+
Application.WorksheetFunction.VLookup(label14.Caption
Workbooks("2.xls").Sheets("1").Range("a1:e200"), 5, False)
)
but am getting the error " unable to get the vlookup property of th
worksheet function"
i also figure i will run into a problem if the vlookup results ar
false. but for right now, I know that the label.captions are located
in the vlookup table.
any help would be appreciated.
full code;
labLCPSF01.Caption
Application.WorksheetFunction.Sum(Application.WorksheetFunction.VLookup(labEDHght01.Caption
Workbooks("bidditdb.xls").Sheets("xl").Range("a3:b25"), 2, False)
Application.WorksheetFunction.VLookup(labEDFlr01.Caption
Workbooks("bidditdb.xls").Sheets("xl").Range("a3:b25"), 2, False)
Application.WorksheetFunction.VLookup(labEDMat01.Caption
Workbooks("bidditdb.xls").Sheets("mat").Range("a1:e200"), 5, False)
label15.Caption =
Application.WorksheetFunction.Sum(
Application.WorksheetFunction.VLookup(label12.Caption
Workbooks("1.xls").Sheets("1").Range("a3:b25"), 2, False)
+
Application.WorksheetFunction.VLookup(label13.Caption
Workbooks("2.xls").Sheets("1").Range("a3:b25"), 2, False)
+
Application.WorksheetFunction.VLookup(label14.Caption
Workbooks("2.xls").Sheets("1").Range("a1:e200"), 5, False)
)
but am getting the error " unable to get the vlookup property of th
worksheet function"
i also figure i will run into a problem if the vlookup results ar
false. but for right now, I know that the label.captions are located
in the vlookup table.
any help would be appreciated.
full code;
labLCPSF01.Caption
Application.WorksheetFunction.Sum(Application.WorksheetFunction.VLookup(labEDHght01.Caption
Workbooks("bidditdb.xls").Sheets("xl").Range("a3:b25"), 2, False)
Application.WorksheetFunction.VLookup(labEDFlr01.Caption
Workbooks("bidditdb.xls").Sheets("xl").Range("a3:b25"), 2, False)
Application.WorksheetFunction.VLookup(labEDMat01.Caption
Workbooks("bidditdb.xls").Sheets("mat").Range("a1:e200"), 5, False)