Dear friends, I have the following macro.
Option Explicit
Public dTime As Date
Sub DynamicRow()
Dim dTime As Date
Dim LR As Long
LR = Range("B" & Cells(Rows.Count).Row).End(xlUp).Row + 1
Range("B" & LR).Value = Range("A1").Value
If LR > 10 Then Range("B2").Delete xlShiftUp
Call StartTimer
End Sub
Sub StartTimer()
dTime = Now + TimeValue("00:01:00")
Application.OnTime dTime, "DynamicRow", Schedule:=True
End Sub
Sub StopTimer()
On Error Resume Next
Application.OnTime dTime, "DynamicRow", Schedule:=False
End Sub
This macro is linked to a command button on Sheet 1 and, when it gets activated, what the macro does is that, every minute, value (which keeps changing) in cell A1 is copied to cell B2 till B10. Once B10 is filled, the next minute, cell B2 is deleted while other cells in the range are shifted up, and the new value is copied to cell B10. This goes on and on as loop.
The above involves only one value and single column but in my actual case, I have the changing values in cells A1 till A20 and I need the above process to run from column B till column U. In other words I need the macro to be reprogrammed to handle a range of values and columns.
Your kind assistance is highly appreciated.
Thank you.
Bookmarks