I have this WB, how to autofill formula to D:G range til the time stamp is same as cell J1
I have this WB, how to autofill formula to D:G range til the time stamp is same as cell J1
Last edited by AS_2011; 01-08-2015 at 08:07 AM.
Hi
In I1,
=MATCH(J1-INT(J1),C4:C47)
In H1, type 1. To stop macro type 0 in H1
Code:Sub StartMacro() Dim r, t As Date, i As Long t = Now() + TimeSerial(0, 0, 5) Application.OnTime t, "StartMacro", , True r = [i1] i = [h1] If Not i = 0 Then If Not IsError(r) Then Range("d4:h4").AutoFill Range("d4:h4").Resize(r) End If Else Debug.Print Now Application.OnTime t, "StartMacro", , False End If End Sub
Cheers !
Excel Range to BBCode Table
Use Social Networking Tools If You Like the Answers !
Message to Cross Posters
@ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)
I can't get it to work, I1 show #N/A when i run the macro, can use macro button to run and stop the macro?
Admin, I think i found the problem, in the time column i am using some formula to get the time, how to add the code to change the time formula to value in your code? when the value of time format is m/dd/yyyy h:mm:ss AM/PM I1 show #N/A, but when i change the time format to h:mm:ss AM/PM, it is good,
Last edited by AS_2011; 01-09-2015 at 12:05 PM.
modify your formula like
=YourOriginalFormula-INT(YourOriginalFormula)
And format the cell as time
Cheers !
Excel Range to BBCode Table
Use Social Networking Tools If You Like the Answers !
Message to Cross Posters
@ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)
Bookmarks