Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default using lookup function in vba

I am trying to use the lookup function in my vba code. I'm using excel 2003.
Here is what I have so far, but it isn't working. I'm getting the error
"unable to get the lookup property of the worksheet function class"

Dim name As String
name = Range("e800")
Dim Start As Integer
Start = Application.WorksheetFunction.Lookup(name, "Q800:Q881", "t800:t881")


This last line is what is highlighted

I'm kind of new to this stuff, so I realize this may sound simple, but I'm
having trouble getting it to work and any help would be appreciated.

Jim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default using lookup function in vba

Try changing this line:

Start = Application.WorksheetFunction.Lookup(name, "Q800:Q881", "t800:t881")

To this:

Start = Application.WorksheetFunction.Lookup(name, _
Range("Q800:Q881"), Range("t800:t881"))





"bigjim" wrote in message
...
I am trying to use the lookup function in my vba code. I'm using excel
2003.
Here is what I have so far, but it isn't working. I'm getting the error
"unable to get the lookup property of the worksheet function class"

Dim name As String
name = Range("e800")
Dim Start As Integer
Start = Application.WorksheetFunction.Lookup(name, "Q800:Q881",
"t800:t881")


This last line is what is highlighted

I'm kind of new to this stuff, so I realize this may sound simple, but I'm
having trouble getting it to work and any help would be appreciated.

Jim



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default using lookup function in vba


I knew it would be something simple. Thanks so much. It works perfectly now.
"bigjim" wrote:

I am trying to use the lookup function in my vba code. I'm using excel 2003.
Here is what I have so far, but it isn't working. I'm getting the error
"unable to get the lookup property of the worksheet function class"

Dim name As String
name = Range("e800")
Dim Start As Integer
Start = Application.WorksheetFunction.Lookup(name, "Q800:Q881", "t800:t881")


This last line is what is highlighted

I'm kind of new to this stuff, so I realize this may sound simple, but I'm
having trouble getting it to work and any help would be appreciated.

Jim

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default using lookup function in vba

If you had been posting a formula to the worksheet, then you would have had
the correct structure for the formula, but in code the keyword Range must be
used so that VBA can compile and execute the formula. Glad it worked for
you.


"bigjim" wrote in message
...

I knew it would be something simple. Thanks so much. It works perfectly
now.
"bigjim" wrote:

I am trying to use the lookup function in my vba code. I'm using excel
2003.
Here is what I have so far, but it isn't working. I'm getting the error
"unable to get the lookup property of the worksheet function class"

Dim name As String
name = Range("e800")
Dim Start As Integer
Start = Application.WorksheetFunction.Lookup(name, "Q800:Q881",
"t800:t881")


This last line is what is highlighted

I'm kind of new to this stuff, so I realize this may sound simple, but
I'm
having trouble getting it to work and any help would be appreciated.

Jim



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
Combining Lookup function and Sum function Cameron Excel Worksheet Functions 2 July 13th 09 02:19 AM
LOOKUP FUNCTION? (LOOKUP VALUE BEING A TIME RENERATED FROM A FORMU JCC Excel Discussion (Misc queries) 5 June 26th 09 09:15 PM
Excel Data Validation/Lookup function does function correcty Kirkey Excel Worksheet Functions 2 May 25th 09 09:22 PM
how to combine an IF Function with a lookup function to determine [email protected] Excel Worksheet Functions 1 December 5th 06 06:09 AM
Pivot table doing a lookup without using the lookup function? NGASGELI Excel Discussion (Misc queries) 0 August 2nd 05 05:08 AM


All times are GMT +1. The time now is 02:20 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"