ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Match Error (https://www.excelbanter.com/excel-programming/302563-vba-match-error.html)

tbieri

VBA Match Error
 
Howdy,

I am having a problem with the following VBA Match code:

Option Explicit

Sub Macro2()

Dim Current_Col As Double
Dim Date_Range As Range

Set Date_Range = Range("M6:FO6")

Current_Col = Application.Match(Date, Date_Range, 1)
ActiveWindow.ScrollColumn = Current_Col

End Sub

Row 6 contains sorted dates and the using the MATCH
function within excel [ie MATCH(Today(),$M$6:$FO$6,1)]
works fine.

Looking for suggestions for this relatviley simple code.

Regards,
Tim

tbieri

VBA Match Error
 
Marcotte;

Thanks for the help, I would not have guessed that DATE was
causing the problem. Works like a charm...

Regards,
Tim


All times are GMT +1. The time now is 01:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com