My goal is to calculate a range every 30 seconds
Command button starts and stops the timer to calculate the range and I am getting my desired result however...
I want to paste the range values to next available column to the right after each update.
With there being a loop statement, I am not sure how to accomplish this.
Attempts have failed with continuous copy paste in all columns. lol
Hope someone can assist.
My AutoUpdate routine
My copy/paste routine
Command button starts and stops the timer to calculate the range and I am getting my desired result however...
I want to paste the range values to next available column to the right after each update.
With there being a loop statement, I am not sure how to accomplish this.
Attempts have failed with continuous copy paste in all columns. lol
Hope someone can assist.
My AutoUpdate routine
VBA Code:
Sub AutoUpdate()
Dim RunningTime As Double
Dim TimerStart As Double
TimerStart = Timer
Do Until Sheets("Sheet1").Range("A1").Value = False
RunningTime = (Timer - TimerStart) / 24 / 60 / 60
If (Format(RunningTime, "ss") Mod 30) = 0 Then Sheets("Sheet1").Range("Data").Calculate
Sheets("Sheet1").Range("TimeStamp").Calculate
DoEvents
Loop
End Sub
My copy/paste routine
VBA Code:
Sub CopyPasteData()
Dim Data As Range
Dim lastCol As Long
Set Data = Worksheets("Sheet1").Range("Data")
lastCol = Cells(2, Columns.Count).End(xlToLeft).Column
Range("Data").Copy
Cells(2, lastCol + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End Sub