I am using the below code to update values every 10 minutes. The macro counts from the bottom of the worksheet and adds the latest value to the blank cell from the bottom up. So basically it is continuously adding values to the next open cell from the bottom which extends the range
Question:
Is there a way to do the reverse? That is, insert a row at the top of the worksheet (create an empty row) and then add the latest value there? The intent is to eventually create a rolling chart because the amount of data that I will be adding will quickly exceed the chart range if the values are continuously being added to the bottom of the worksheet and not the top.
Any help or guidance would be greatly appreciated
Thanks,
-CBear
Sub Copy_A1B1()
' Sets screen updating to false to prevent screen flicker
Application.ScreenUpdating = False
' Select Sheet1 cells A1 and B1 and copy
Worksheets("Sheet1").Range("A1:B1").Copy
' Find the next empty row based on column A
Worksheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1).Select
' Paste the copied data
ActiveSheet.Paste
' Call the "TimerReset" macro
Call TimerReset
' Save the workbook
ActiveWorkbook.Save
End Sub
Sub TimerReset()
' Instructs Excel to run "Copy_A1B1" macro again in 15 minutes
Application.OnTime Now + TimeValue("00:10:00"), "Copy_A1B1"
End Sub
Question:
Is there a way to do the reverse? That is, insert a row at the top of the worksheet (create an empty row) and then add the latest value there? The intent is to eventually create a rolling chart because the amount of data that I will be adding will quickly exceed the chart range if the values are continuously being added to the bottom of the worksheet and not the top.
Any help or guidance would be greatly appreciated
Thanks,
-CBear
Sub Copy_A1B1()
' Sets screen updating to false to prevent screen flicker
Application.ScreenUpdating = False
' Select Sheet1 cells A1 and B1 and copy
Worksheets("Sheet1").Range("A1:B1").Copy
' Find the next empty row based on column A
Worksheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1).Select
' Paste the copied data
ActiveSheet.Paste
' Call the "TimerReset" macro
Call TimerReset
' Save the workbook
ActiveWorkbook.Save
End Sub
Sub TimerReset()
' Instructs Excel to run "Copy_A1B1" macro again in 15 minutes
Application.OnTime Now + TimeValue("00:10:00"), "Copy_A1B1"
End Sub