Well, these are my latest Macros, and everything seems to be working fine:
Workbook:
Private Sub Workbook_Open()
If Weekday(Date) <> 1 And Weekday(Date) <> 7 Then
Application.OnTime Now, "Sheet7.MntCalculate"
End If
End Sub
Sheet7:
Sub MntCalculate()
If TimeValue(Now) > TimeValue("08:55:00") And TimeValue(Now) < TimeValue("09:15:00") Then
Range("L2:NW218").ClearContents
Application.OnTime Now + TimeValue("00:00:01"), "Sheet7.MntCalculate"
Else
If TimeValue(Now) > TimeValue("09:14:59") And TimeValue(Now) < TimeValue("15:30:01") Then
Application.Calculation = xlCalculationAutomatic
ActiveWorkbook.RefreshAll
LC = Application.Max(11, Cells(2, Columns.Count).End(xlToLeft).Column + 1)
For i = 2 To 218
Cells(i, LC) = Range("J" & i)
Next i
Application.OnTime Now + TimeValue("00:01:00"), "Sheet7.MntCalculate"
Else
Application.OnTime Now + TimeValue("00:00:01"), "Sheet7.MntCalculate"
End If
End If
End Sub
Thank you xladept for all the help you provided.
I'll come back to start another thread if I still face any problems with the codes.
Swarnendu
Bookmarks