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

Hi,

When I try the following I always get Run-time Error '1004': Unable to get
the Match property of the WorksheetFunction class

Workbooks.Open Filename:=filenaam, ReadOnly:=True
myVar = Application.WorksheetFunction.Match(9,
Worksheets(1).Range("A1:A10"), 0)
MsgBox myVar


What is the fault, I don't really see it.


Thanks a lot in advance,

Yves


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Worksheetfunction MATCH

Is there a 9 in Range A1:A10?

If not, then Match raises an error such as you describe.

Sub tester1()
On Error Resume Next
myvar = Empty
myvar = Application.WorksheetFunction.Match(9, _
Worksheets(1).Range("A1:A10"), 0)
On Error GoTo 0
If myvar < Empty Then
MsgBox myvar
Else
MsgBox "Not found"
End If
End Sub


Might be an approach you can use.

--
Regards,
Tom Ogilvy

"Yves Janssens" wrote in message
.be...
Hi,

When I try the following I always get Run-time Error '1004': Unable to get
the Match property of the WorksheetFunction class

Workbooks.Open Filename:=filenaam, ReadOnly:=True
myVar = Application.WorksheetFunction.Match(9,
Worksheets(1).Range("A1:A10"), 0)
MsgBox myVar


What is the fault, I don't really see it.


Thanks a lot in advance,

Yves




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Worksheetfunction MATCH

Tom,

Thanks a lot. There indeed is no value 9 in that range.
But, I never thaught it would generate this error.

Thanks a lot,

Yves

"Tom Ogilvy" wrote in message
...
Is there a 9 in Range A1:A10?

If not, then Match raises an error such as you describe.

Sub tester1()
On Error Resume Next
myvar = Empty
myvar = Application.WorksheetFunction.Match(9, _
Worksheets(1).Range("A1:A10"), 0)
On Error GoTo 0
If myvar < Empty Then
MsgBox myvar
Else
MsgBox "Not found"
End If
End Sub


Might be an approach you can use.

--
Regards,
Tom Ogilvy

"Yves Janssens" wrote in message
.be...
Hi,

When I try the following I always get Run-time Error '1004': Unable to

get
the Match property of the WorksheetFunction class

Workbooks.Open Filename:=filenaam, ReadOnly:=True
myVar = Application.WorksheetFunction.Match(9,
Worksheets(1).Range("A1:A10"), 0)
MsgBox myVar


What is the fault, I don't really see it.


Thanks a lot in advance,

Yves






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
WorksheetFunction.Vlookup leerem Excel Discussion (Misc queries) 8 October 25th 08 07:58 PM
WorksheetFunction help Ayo Excel Discussion (Misc queries) 2 July 20th 08 10:48 PM
Can't use WorksheetFunction Yossi Excel Discussion (Misc queries) 5 January 25th 06 10:07 PM
WorksheetFunction with VBA Ghislain Marcotte Excel Discussion (Misc queries) 2 February 13th 05 07:08 AM
Application.WorksheetFunction.Match problem Carl Brehm Excel Worksheet Functions 1 January 9th 05 02:08 PM


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