Hi,
Slightly changed code. Now values from range J1:J3 will be copied to column D to the right from according time.
Make sure that time in H1 is in column B, if not - you will see message box and nothing will happen.
Sub Button1_Click()
If IsError(Application.Match(Sheets("Sheet1").Range("H1"), Sheets("Sheet1").Range("B:B"), 0)) Then
MsgBox "No time found in table"
Exit Sub
End If
Application.OnTime Sheets("Sheet1").Range("H1"), "CopyValues"
End Sub
Sub CopyValues()
Sheets("Sheet1").Range("J1:J3").Copy Sheets("Sheet1").Range("D" & Application.Match(Sheets("Sheet1").Range("H1"), Sheets("Sheet1").Range("B:B"), 0))
End Sub
Bookmarks