Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Cann't use "Match" function inside VBA

Saurabh,

You need to pass an actual range to the Match function, not a address
string. Change your formula to

On Error Resume Next
Position = Application.WorksheetFunction.Match(54.2, Range("N2:N100"), 1)
If Err.Number = 0 Then
' match found
Else
' match not found
End If



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com



"Saurabh" wrote in message
m...
I wanted to use the 'Match' function in Excel inside my VBA
Application. I cann't seem to achieve this.

The code is as follows : -



Position = Application.WorksheetFunction.Match(54.2, "N2:N100", 1)

<<


Upon execution, the application gives me the error message : -

"Unable to get the Match property of the WorksheetFunction class"

I have tried various suggestions like installing Analysis Pak addin
and creating a reference to atpvbaen.xls file, but none seem to work.

Please advise me urgently as the project is in its cruicial stage.

Thanks

Saurabh



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
Text "comparison" operator for "contains" used in an "IF" Function Pawaso Excel Worksheet Functions 4 April 4th 23 11:35 AM
"IN Operator" using Match function.... [email protected] Excel Worksheet Functions 2 January 9th 09 09:25 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
How do I run a macro from inside an"=IF" formula in Excel 2003? Drawn83 Excel Worksheet Functions 1 June 4th 07 08:38 PM
How to replace "#N/A" w "0"when vlookup couldn't find the match? Holly Excel Discussion (Misc queries) 2 July 17th 06 11:48 PM


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