The code below is throwing a Run-Time Error 424 - Object Required. The bolded line below is highlighted by the debugger. I've also checked the values while debugging; sdcon is the date that it should be (6/6/2011, based on the cell I've been starting with). I've also deliberately set the dates range as the exact cell it should be, which it shows up as when I check the value during debugging, but no matter what I've done to that formula, I cannot get past the Object Required error.
And ideas, please? This is driving me insane because I'm so close to being done with this project...
Thanks!
Private Sub btn_OK_Click()
Dim theschedule As Range
Set theschedule = ActiveCell
Dim sdcon As Date
Dim edcon As Date
sdcon = Format$(txt_Start.Text, "m/d/yyyy")
edcon = Format$(txt_End.Text, "m/d/yyyy")
Dim dates As Range
Set dates = Sheets(1).Range("A2:IH2")
Dim cstart As Range
Dim cend As Range
Dim dstart As Long
Dim dend As Long
Dim i As Long
Set cstart = Application.Match(sdcon, dates, 0)
Set cend = Application.Match(edcon, dates, 0)
dstart = cstart.Cells.Column
dend = cend.Cells.Column
Select Case True
'Do Work
End Select
Unload Me
End Sub
Bookmarks