I have an Excel spreadsheet in which I need to go to the column corresponding to the current date. I created a command button with the following sub:
Private Sub bActualToday_Click()
' Variables
Dim dToday As Date
Dim rDates, rToday As Range
rDates = Worksheets("Actual".Range("J2:IS2"
dToday = Date
rToday = rDates.Find(dToday, LookIn:=xlValues)
rToday.Activate
End Sub
I'm thinking that the problem is the type mismatch between dToday and what Find is expecting or the way Excel stores dates in cells. I thought I read once that Excel stores dates as doubles but redefining dToday as a double doesn't work.
TIA,
Imagineer
[sig][/sig]
Private Sub bActualToday_Click()
' Variables
Dim dToday As Date
Dim rDates, rToday As Range
rDates = Worksheets("Actual".Range("J2:IS2"
dToday = Date
rToday = rDates.Find(dToday, LookIn:=xlValues)
rToday.Activate
End Sub
I'm thinking that the problem is the type mismatch between dToday and what Find is expecting or the way Excel stores dates in cells. I thought I read once that Excel stores dates as doubles but redefining dToday as a double doesn't work.
TIA,
Imagineer
[sig][/sig]