LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Excel2000 VBA: A problem with worksheetfunction MATCH

Hi

I need to find the first occurrence of a date in range on sheet in my
procedure code. The range is on active sheet ("Data") of active workbook,
and is defined as a dynamic range DataDate (which returns a range
Data!$B$2:$B#). (Searched data is read from InputBox.) The code below
returns an error: "Unable to get the Match property of the WorksheetFunction
class"
......
varRow1 = Application.WorksheetFunction.Match(CDate(varDate) ,
[DataDate], 0) + 1

......

The same error is returned, when I modify the code to
......
varDataDate = [DataDate]
......
varRow1 = Application.WorksheetFunction.Match(CDate(varDate) ,
varDataDate, 0) + 1

......

Both [DataDate] and varDataDate are functional - in watch window:
varDataDate - Type = Variant/Variant(1 to 4688, 1 to 1)
[DataDate] - Type = Variant/Object/Range

And the same error is returned with code:
......
varRow1 = Application.WorksheetFunction.Match(CDate(varDate) ,
ThisWorkbook.Sheets("Data").Range("B2:B" & ([DataRows]-1)), 0) + 1
......

where the named range DataRows returns last used row on sheet Data.

I'm trying to solve this from yesterday on - and no success so long. Maybe
someone here can help!

Thanks in advance!

--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )


 
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.WorksheetFunction.Match problem Carl Brehm Excel Worksheet Functions 1 January 9th 05 02:08 PM
VBA WorksheetFunction problem Jeff Wright[_2_] Excel Programming 3 December 11th 04 04:53 AM
Syntax for WorksheetFunction Match Hardy[_3_] Excel Programming 1 June 4th 04 11:33 AM
worksheetfunction.match David Robinson[_3_] Excel Programming 4 November 15th 03 06:35 PM
Worksheetfunction MATCH Yves Janssens Excel Programming 2 October 6th 03 03:25 PM


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