Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Applications / Excel / April 2007



Tip: Looking for answers? Try searching our database.

Application.worksheetfunction.match

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin Beir - 26 Apr 2007 18:53 GMT
Dear All,

I find that the following code:

Application.worksheetfunction.match(lookup_value,look up_array, 1)

works fine unless the lookup_value is a date when it fails though the match
function will work with dates when entered into a worksheet cell.

I can work through my array with For_Next or Do_Until but feel this should
not be necessary.

Any comments?

Martin
JE McGimpsey - 27 Apr 2007 15:35 GMT
> I find that the following code:
>
> Application.worksheetfunction.match(lookup_value,look up_array, 1)
>
> works fine unless the lookup_value is a date when it fails though the match
> function will work with dates when entered into a worksheet cell.

While it probably would be more helpful to have seen your code, one of
the problems with Match and dates is that Match looks at the underlying
cell value, so it attempts to match the serial number of the date, not
the displayed representation. Therefore one should look for the numeric
value.

In addition, VBA uses the 1900 date system rather than the Mac default
1904 date system, so one may need to correct for the difference.

This works for me, in the 1904 date system if 4/27/2007 is entered in a
cell in column A:

a = Application.WorksheetFunction.Match( _
       CLng(#4/30/2007# - 1462), Range("A:A"), False)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.