Results 1 to 20 of 22

Thread: Macro for copying the value of one Cell to another cell(s) in specific time interval

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #19
    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 mdmackillop for all the help you provided.

    I'll come back to start another thread if I still face any problems with the codes.

    Swarnendu
    Last edited by Swarnendu; 07-19-2017 at 03:28 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •