Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default VLookup Problem

I've got the following code, but it returns "#REF!" into the cell that
I was expecting the value - can anyone tell me what I've done wrong?

I've double checked and it should be finding something in the target
workbook:

----------

Sub Find_Values()
Dim CustNo As String
CustNo = "GB-NAA001"
Address = Application.VLookup(CustNo, Workbooks("2009-05
Server_Utilisation.xls").Sheets("Server_Utilisatio n").Range("$C$25:$C
$1000"), 3, False)
Range("A1") = Address
End Sub

-----------

Many thanks for any advice.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default VLookup Problem

It doesn't like the value "3" in the end of the VLookup command, if I
change it to 1 it works fine but I don't want to return the value I am
looking for - how can I get the value back from the same row but for
columns "I" and "O" etc?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default VLookup Problem

Ignore me, of course you have to include in the range the columns you
want returning, sorry to waste your bandwidth, this worked:

Address = Application.VLookup(CustNo, Workbooks("2009-05
Server_Utilisation.xls").Sheets("Server_Utilisatio n").Range("$C$25:$I
$1000"), 3, False)
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default VLookup Problem

in the "Immediate" window, out this
? Application.VLookup(CustNo, Workbooks("2009-05
Server_Utilisation.xls").Sheets("Server_Utilisatio n").Range("$C$25:$C
$1000"), 3, False)

and see what happens.



"David" wrote in message
...
I've got the following code, but it returns "#REF!" into the cell that
I was expecting the value - can anyone tell me what I've done wrong?

I've double checked and it should be finding something in the target
workbook:

----------

Sub Find_Values()
Dim CustNo As String
CustNo = "GB-NAA001"
Address = Application.VLookup(CustNo, Workbooks("2009-05
Server_Utilisation.xls").Sheets("Server_Utilisatio n").Range("$C$25:$C
$1000"), 3, False)
Range("A1") = Address
End Sub

-----------

Many thanks for any advice.


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
Problem with Vlookup Confused Excel Worksheet Functions 10 April 23rd 09 07:20 PM
Vlookup problem - unable to get the vlookup property Fred Excel Programming 2 August 22nd 08 05:23 PM
VLOOKUP Problem Leslie Excel Worksheet Functions 5 April 10th 08 06:43 PM
VLOOKUP Problem Ross Excel Discussion (Misc queries) 1 June 20th 06 05:01 PM
VLOOKUP problem Jason Excel Worksheet Functions 2 January 14th 05 10:39 PM


All times are GMT +1. The time now is 05:25 PM.

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"