PDA

View Full Version : Macro to auto-copy a cell and paste it in a another cell at particular times



eakpan2012
10-19-2018, 10:04 AM
Macro to auto-copy a cell from particular column and pasteit in a particular cell in a different column at particular times. This macroshould automatically conduct these operations based on actual times from thecomputer

Example: when it is 5am, the macro copies the value in cellk4 and pastes it in m1, then when it is 6am the macro copies the value in cellk4 and pastes it in m2, then when it is 7am the macro copies the value in cellk4 and pastes it in m3, and so on!
Please assist with model code.

mdmackillop
10-22-2018, 02:06 PM
Sub Test()
Application.OnTime TimeValue("05:00:00"), "DoCopy1"
Application.OnTime TimeValue("06:00:00"), "DoCopy2"
Application.OnTime TimeValue("07:00:00"), "DoCopy3"
End Sub


Sub DoCopy1()
Cells(1, 13).Value = Cells(4, 11).Value
End Sub


Sub DoCopy2()
Cells(2, 13).Value = Cells(4, 11).Value
End Sub


Sub DoCopy3()
Cells(3, 13).Value = Cells(4, 11).Value
End Sub

p45cal
10-23-2018, 02:16 AM
cross posted all over the place.