LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Application.Match

Few things here.

"SIGE" wrote in message
om...
Why does Application.Match or Application.Worksheetfunction.Match
not work with integers as look-up value?


Match does work with an integer value, but you have to get the syntax
correct.

When comparing with integers, why do you use a string?
The range is not the same in VBA as in Excel, you have to adapt.

I read there is a difference between both functions ...but coul'n't
get in what way there is a difference...


The difference lies in its error handling. In XL97, there was a problem with
the WorksheetFunction form of Match that did not manifest with
Application.Match. Myrna Larson reporst that she has experienced that
problem in later versions. For that reason, it is generally agrreed to be
safe rather than sorry and use Application.Match.

'fill row1 wihth the numbers 1,2,3,4,5,... and I get a type mismatch,
error 13 on running underneath sub.

Sub test()
Dim sige As Integer
sige = Application.WorksheetFunction.Match("1", "Sheet1!$A$1:$K$1", 0)
MsgBox sige
End Sub


With correct syntax, and some error handling, it should work okay

Sub test()
Dim sige
On Error Resume Next
sige = Application.Match(99, Range("Sheet3!$A$1:$K$1"), 0)
If Not IsError(sige) Then
MsgBox sige
End If
On Error GoTo 0
End Sub



 
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
application.match Chip Smith Excel Discussion (Misc queries) 3 March 30th 06 08:56 PM
Application.Match [email protected] Excel Programming 5 September 2nd 04 04:22 PM
Application.Match [email protected] Excel Programming 1 September 2nd 04 08:20 AM
Application.Match [email protected] Excel Programming 0 September 2nd 04 12:07 AM
Application.Match [email protected] Excel Programming 0 September 1st 04 11:06 PM


All times are GMT +1. The time now is 02:33 PM.

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"