#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLLOKUP AND SPACES toolman Excel Worksheet Functions 3 March 30th 07 03:54 AM
Vllokup rk0909 Excel Discussion (Misc queries) 2 February 23rd 07 07:59 PM
VLLOKUP formulas mr_teacher Excel Discussion (Misc queries) 4 July 25th 06 08:26 PM
VLLOKUP - more than one result?? luvthavodka Excel Worksheet Functions 3 May 27th 06 06:15 AM
Using VLLOKUP Cessna12 Excel Worksheet Functions 1 January 24th 05 02:42 PM


All times are GMT +1. The time now is 04:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"