Hello,
I have an excel list with (column A Blank) (Column B Date) (Column C Time) (Column D Activity) I'm trying to use the find method to copy the activity to column F At a time that is selected on another worksheet.
Here is the Code:
Sub Test1()
Dim t As Date
Dim r As Range
Dim lr As Long
lr = Sheets("test").Range("c2").CurrentRegion.Rows.Count
t = Sheets("Rules").Range("E6").Value
Sheets("Test").Select
Range("c2").Select
'Set r = Range(Cells(2, 3), Cells(lr, 3)).Find(What:=CDate(t), Lookat:=xlWhole, LookIn:=xlValues)
'r.Offset(, 6).Value = r.Offset(, 1).Value
End Sub
I get an error code 91 at the last line
r.offset(, 6).Value = r.Offset(, 1).value
Thanks for any help
Steve
I have an excel list with (column A Blank) (Column B Date) (Column C Time) (Column D Activity) I'm trying to use the find method to copy the activity to column F At a time that is selected on another worksheet.
Here is the Code:
Sub Test1()
Dim t As Date
Dim r As Range
Dim lr As Long
lr = Sheets("test").Range("c2").CurrentRegion.Rows.Count
t = Sheets("Rules").Range("E6").Value
Sheets("Test").Select
Range("c2").Select
'Set r = Range(Cells(2, 3), Cells(lr, 3)).Find(What:=CDate(t), Lookat:=xlWhole, LookIn:=xlValues)
'r.Offset(, 6).Value = r.Offset(, 1).Value
End Sub
I get an error code 91 at the last line
r.offset(, 6).Value = r.Offset(, 1).value
Thanks for any help
Steve