Hello All,

I am trying to use some vba match function code to return the column number of the matching date. The date will be stored in a date variable.

Every time I run this code I normally get a match error even though the date is in the worksheet and the variable matches that date.

See below:
Dim dateclmn as double
dim rng as range
dim dt as date

date = InputBox( _
        "Enter the Date you are checking for, example: 8/23/14", "Type Date")
Set rng = Sheets(1).Range("A1:Bs1")

dateclmn = Application.Match(dt, rng, 0) + (rng.Column - 1)

Thanks