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

I am trying to return a value (RES) using INDEX/MATCH in VBA.

Res = WorksheetFunction.Index (Range("LOOKUP81!$A$1:$B$3",MATCH(Range("81!F"
& Z),Range("LOOKUP81!$A$1:$A$3),0,2)))

I trying to find a match and return a value. The statement continues to
error out. It works fine as a formula through the application =INDEX
(LOOKUP81!$A$1:$B$3,MATCH($F5,LOOKUP81!$A$1:$A$3,0 ),2)

Please assist.

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default WorkSheet Function

Hi
there are some missing parenthesis. Try
Res = WorksheetFunction.Index
(Range("LOOKUP81!$A$1:$B$3"),MATCH(Range("81!F"&
Z),Range("LOOKUP81!$A$1:$A$3"),0),2)

--
Regards
Frank Kabel
Frankfurt, Germany


Dthmtlgod wrote:
I am trying to return a value (RES) using INDEX/MATCH in VBA.

Res = WorksheetFunction.Index
(Range("LOOKUP81!$A$1:$B$3",MATCH(Range("81!F" &
Z),Range("LOOKUP81!$A$1:$A$3),0,2)))

I trying to find a match and return a value. The statement continues
to error out. It works fine as a formula through the application
=INDEX (LOOKUP81!$A$1:$B$3,MATCH($F5,LOOKUP81!$A$1:$A$3,0 ),2)

Please assist.

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default WorkSheet Function

Thank Frank.

I changed it to the following

Res = WorksheetFunction.Index(Range("LOOKUP81!$A$1:$B$3" ),
WorksheetFunction.Match(Range("81!F" & Z), Range("LOOKUP81!$A$1:$A$3"), 0),
2)

I added the WorksheetFunction.Match, now I am receiving a

Run-time error '1004'
Unable to get the Match property of the WorksheetFunction class

????

Am I missing something in the Match function?


"Frank Kabel" wrote in message
...
Hi
there are some missing parenthesis. Try
Res = WorksheetFunction.Index
(Range("LOOKUP81!$A$1:$B$3"),MATCH(Range("81!F"&
Z),Range("LOOKUP81!$A$1:$A$3"),0),2)

--
Regards
Frank Kabel
Frankfurt, Germany


Dthmtlgod wrote:
I am trying to return a value (RES) using INDEX/MATCH in VBA.

Res = WorksheetFunction.Index
(Range("LOOKUP81!$A$1:$B$3",MATCH(Range("81!F" &
Z),Range("LOOKUP81!$A$1:$A$3),0,2)))

I trying to find a match and return a value. The statement continues
to error out. It works fine as a formula through the application
=INDEX (LOOKUP81!$A$1:$B$3,MATCH($F5,LOOKUP81!$A$1:$A$3,0 ),2)

Please assist.

Thanks




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default WorkSheet Function

Hi
try
with application.worksheetfunction
Res = .Index(Range("LOOKUP81!$A$1:$B$3"),.Match(Range("L OOKUP81!F"
& Z), _
Range("LOOKUP81!$A$1:$A$3"), 0),2)
end with


--
Regards
Frank Kabel
Frankfurt, Germany


Dthmtlgod wrote:
Thank Frank.

I changed it to the following

Res = WorksheetFunction.Index(Range("LOOKUP81!$A$1:$B$3" ),
WorksheetFunction.Match(Range("81!F" & Z),
Range("LOOKUP81!$A$1:$A$3"), 0), 2)

I added the WorksheetFunction.Match, now I am receiving a

Run-time error '1004'
Unable to get the Match property of the WorksheetFunction class

????

Am I missing something in the Match function?


"Frank Kabel" wrote in message
...
Hi
there are some missing parenthesis. Try
Res = WorksheetFunction.Index
(Range("LOOKUP81!$A$1:$B$3"),MATCH(Range("81!F"&
Z),Range("LOOKUP81!$A$1:$A$3"),0),2)

--
Regards
Frank Kabel
Frankfurt, Germany


Dthmtlgod wrote:
I am trying to return a value (RES) using INDEX/MATCH in VBA.

Res = WorksheetFunction.Index
(Range("LOOKUP81!$A$1:$B$3",MATCH(Range("81!F" &
Z),Range("LOOKUP81!$A$1:$A$3),0,2)))

I trying to find a match and return a value. The statement
continues to error out. It works fine as a formula through the
application =INDEX
(LOOKUP81!$A$1:$B$3,MATCH($F5,LOOKUP81!$A$1:$A$3,0 ),2)

Please assist.

Thanks


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default WorkSheet Function

Hi Frank.

I am still receiving the same error. I added the With
Application.WorksheetFunction, etc.

Run-time error '1004'
Unable to get the Match property of the WorksheetFunction class

Any ideas?


"Frank Kabel" wrote in message
...
Hi
try
with application.worksheetfunction
Res = .Index(Range("LOOKUP81!$A$1:$B$3"),.Match(Range("L OOKUP81!F"
& Z), _
Range("LOOKUP81!$A$1:$A$3"), 0),2)
end with


--
Regards
Frank Kabel
Frankfurt, Germany


Dthmtlgod wrote:
Thank Frank.

I changed it to the following

Res = WorksheetFunction.Index(Range("LOOKUP81!$A$1:$B$3" ),
WorksheetFunction.Match(Range("81!F" & Z),
Range("LOOKUP81!$A$1:$A$3"), 0), 2)

I added the WorksheetFunction.Match, now I am receiving a

Run-time error '1004'
Unable to get the Match property of the WorksheetFunction class

????

Am I missing something in the Match function?


"Frank Kabel" wrote in message
...
Hi
there are some missing parenthesis. Try
Res = WorksheetFunction.Index
(Range("LOOKUP81!$A$1:$B$3"),MATCH(Range("81!F"&
Z),Range("LOOKUP81!$A$1:$A$3"),0),2)

--
Regards
Frank Kabel
Frankfurt, Germany


Dthmtlgod wrote:
I am trying to return a value (RES) using INDEX/MATCH in VBA.

Res = WorksheetFunction.Index
(Range("LOOKUP81!$A$1:$B$3",MATCH(Range("81!F" &
Z),Range("LOOKUP81!$A$1:$A$3),0,2)))

I trying to find a match and return a value. The statement
continues to error out. It works fine as a formula through the
application =INDEX
(LOOKUP81!$A$1:$B$3,MATCH($F5,LOOKUP81!$A$1:$A$3,0 ),2)

Please assist.

Thanks






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default WorkSheet Function

Hi
are you sure the range names are correct 8e.g. the sheet names exist,
etc.)

--
Regards
Frank Kabel
Frankfurt, Germany

"Dthmtlgod" schrieb im Newsbeitrag
...
Hi Frank.

I am still receiving the same error. I added the With
Application.WorksheetFunction, etc.

Run-time error '1004'
Unable to get the Match property of the WorksheetFunction class

Any ideas?


"Frank Kabel" wrote in message
...
Hi
try
with application.worksheetfunction
Res =

..Index(Range("LOOKUP81!$A$1:$B$3"),.Match(Range(" LOOKUP81!F"
& Z), _
Range("LOOKUP81!$A$1:$A$3"), 0),2)
end with


--
Regards
Frank Kabel
Frankfurt, Germany


Dthmtlgod wrote:
Thank Frank.

I changed it to the following

Res = WorksheetFunction.Index(Range("LOOKUP81!$A$1:$B$3" ),
WorksheetFunction.Match(Range("81!F" & Z),
Range("LOOKUP81!$A$1:$A$3"), 0), 2)

I added the WorksheetFunction.Match, now I am receiving a

Run-time error '1004'
Unable to get the Match property of the WorksheetFunction class

????

Am I missing something in the Match function?


"Frank Kabel" wrote in message
...
Hi
there are some missing parenthesis. Try
Res = WorksheetFunction.Index
(Range("LOOKUP81!$A$1:$B$3"),MATCH(Range("81!F"&
Z),Range("LOOKUP81!$A$1:$A$3"),0),2)

--
Regards
Frank Kabel
Frankfurt, Germany


Dthmtlgod wrote:
I am trying to return a value (RES) using INDEX/MATCH in VBA.

Res = WorksheetFunction.Index
(Range("LOOKUP81!$A$1:$B$3",MATCH(Range("81!F" &
Z),Range("LOOKUP81!$A$1:$A$3),0,2)))

I trying to find a match and return a value. The statement
continues to error out. It works fine as a formula through the
application =INDEX
(LOOKUP81!$A$1:$B$3,MATCH($F5,LOOKUP81!$A$1:$A$3,0 ),2)

Please assist.

Thanks





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
IF/AND worksheet function Fan924 Excel Discussion (Misc queries) 5 June 21st 09 07:05 AM
Need VBA for a worksheet function xjetjockey Excel Discussion (Misc queries) 6 January 8th 07 05:29 PM
worksheet function tiq Excel Worksheet Functions 1 August 24th 06 07:58 PM
Reference the worksheet from a multiple worksheet range function ( DBickel Excel Worksheet Functions 1 May 28th 05 03:49 AM
Can the offset worksheet function reference another worksheet AlistairJ Excel Worksheet Functions 2 May 9th 05 06:18 PM


All times are GMT +1. The time now is 11:31 AM.

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

About Us

"It's about Microsoft Excel"