Looping a data logging vba script

LS501

New Member
Joined
Jul 17, 2009
Messages
3
Hello,

I'm currently trying to use this data logging script (below) developed by mrexcel members and it works great! However, I'm defining c to be about 15 and need it to loop such that the data shifts up one to maintain 15 data points AND on the last row add a new/current data point. I was thinking a loop vba to do this. Perhaps you guys have a better idea. Any help would greatly be appreciated... Thanks :)

Code:
Private Sub Worksheet_Calculate()

c = Range("A" & Rows.Count).End(xlUp).Row 'Identifies last row in Column A with data

If c = 12 Then

Exit Sub

Else

Range("A" & c + 1).Value = Range("A1").Value
Range("B" & c + 1).Value = Range("B1").Value

End If

End Sub
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,216,934
Messages
6,133,602
Members
449,819
Latest member
belowram

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top