Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vllokup
Table is a name I have defined, the following is my vlookup with which I get object-defined error, many Thanks Sub test() Cells(2, 9) = WorksheetFunction.VLookup(Cells(2, 7), Table, 2, 0) End Sub -- T De Villiers ------------------------------------------------------------------------ T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479 View this thread: http://www.excelforum.com/showthread...hreadid=566961 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vllokup
VBA does not know what Table means. You have to tell it that it is a Range.
Cells(2, 9) = WorksheetFunction.VLookup(Cells(2, 7), Range(Table), 2, 0) Be careful of which sheet these Cells/Range objects are pointing to. NickHK "T De Villiers" wrote in message news:T.De.Villiers.2butf0_1154423705.0108@excelfor um-nospam.com... Table is a name I have defined, the following is my vlookup with which I get object-defined error, many Thanks Sub test() Cells(2, 9) = WorksheetFunction.VLookup(Cells(2, 7), Table, 2, 0) End Sub -- T De Villiers ------------------------------------------------------------------------ T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479 View this thread: http://www.excelforum.com/showthread...hreadid=566961 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vllokup
Hi
Try Cells(2, 9) = WorksheetFunction.VLookup(Cells(2, 7), "Table", 2, FALSE) The range name must be in quotes. regards Paul T De Villiers wrote: Table is a name I have defined, the following is my vlookup with which I get object-defined error, many Thanks Sub test() Cells(2, 9) = WorksheetFunction.VLookup(Cells(2, 7), Table, 2, 0) End Sub -- T De Villiers ------------------------------------------------------------------------ T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479 View this thread: http://www.excelforum.com/showthread...hreadid=566961 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vllokup
oops - should be Range("Table") in VBA.
regards Paul wrote: Hi Try Cells(2, 9) = WorksheetFunction.VLookup(Cells(2, 7), "Table", 2, FALSE) The range name must be in quotes. regards Paul T De Villiers wrote: Table is a name I have defined, the following is my vlookup with which I get object-defined error, many Thanks Sub test() Cells(2, 9) = WorksheetFunction.VLookup(Cells(2, 7), Table, 2, 0) End Sub -- T De Villiers ------------------------------------------------------------------------ T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479 View this thread: http://www.excelforum.com/showthread...hreadid=566961 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Vllokup
Roedd <<T De Villiers wedi ysgrifennu:
Table is a name I have defined, the following is my vlookup with which I get object-defined error, many Thanks Sub test() Cells(2, 9) = WorksheetFunction.VLookup(Cells(2, 7), Table, 2, 0) End Sub At a guess: Cells(2, 9) = WorksheetFunction.VLookup(Cells(2, 7), Range("Table"), 2, 0) HTH Rob |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VLLOKUP AND SPACES | Excel Worksheet Functions | |||
Vllokup | Excel Discussion (Misc queries) | |||
VLLOKUP formulas | Excel Discussion (Misc queries) | |||
VLLOKUP - more than one result?? | Excel Worksheet Functions | |||
Using VLLOKUP | Excel Worksheet Functions |