Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Using WorksheetFunctions in Excel Macros

I want to use the Excel Worksheet Function Match to find
an entry in a range. When attempting to execute, I get
error code 1004. Unable to get the Match Property of the
Worksheet function class.

ndx = Application.WorksheetFunction.Match(aDate, "AMGN!
Date")

What is not available?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Using WorksheetFunctions in Excel Macros

Hi
this is probably our second parameter. Is this a defined name?.
the following should work:
ndx = Application.WorksheetFunction.Match(aDate, Range("A1:A100"))
if aDate exists within your range

--
Regards
Frank Kabel
Frankfurt, Germany

Ken wrote:
I want to use the Excel Worksheet Function Match to find
an entry in a range. When attempting to execute, I get
error code 1004. Unable to get the Match Property of the
Worksheet function class.

ndx = Application.WorksheetFunction.Match(aDate, "AMGN!
Date")

What is not available?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Using WorksheetFunctions in Excel Macros

Hi Ken,

Match is expecting the second argument to be a range, but you are giving it
a text string. Try something like:

Sub A()
Dim nIdx As Long
Dim W As Worksheet

Set W = ThisWorkbook.Worksheets(1)
nIdx = Application.WorksheetFunction.Match("c", W.Range("Rng"))
Debug.Print nIdx
End Sub

For the named range Rng.

HTH

Peter Beach

"Ken" wrote in message
...
I want to use the Excel Worksheet Function Match to find
an entry in a range. When attempting to execute, I get
error code 1004. Unable to get the Match Property of the
Worksheet function class.

ndx = Application.WorksheetFunction.Match(aDate, "AMGN!
Date")

What is not available?



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
Excel 2007 macros - how to merge 5 macros together into one Sue Excel Discussion (Misc queries) 1 April 16th 08 08:36 PM
Training: More on how to use macros in Excel: Recording Macros ToriT Excel Worksheet Functions 2 February 10th 06 07:05 PM
excel.worksheetfunctions Max Excel Worksheet Functions 13 November 26th 05 02:25 AM
No VBA help for Worksheetfunctions available Toppers Excel Worksheet Functions 4 January 23rd 05 04:58 PM
Making excel macros run Word macros Matthew McManus Excel Programming 1 February 18th 04 02:57 AM


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