Is there a way to specify a time range to do a specific task?
If Time Value is before 10:00:00 or between 13:00:00 and 16:00:00 Then
Do 'THis.
If TimeValue.Now() <> TimeValue("10:00:00", "16:00:00") Then
Workbooks("Inventory_New.xls").Activate
With ActiveWorkbook
Sheets("Sheet3").Activate
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
With Range("A1:IR" & WorksheetFunction.Max(9, Lastrow))
.ClearContents
End With
End With
OR
If TimeValue.Now() <TimeValue("10:00:00") or _
TimeValue.Now() >TimeValue("16:00:00") Then
Workbooks("Inventory_New.xls").Activate
With ActiveWorkbook
Sheets("Sheet3").Activate
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
With Range("A1:IR" & WorksheetFunction.Max(9, Lastrow))
.ClearContents
End With
End With
Bookmarks