Count sheet refresh

elviajero

Board Regular
Joined
Jun 5, 2015
Messages
97
I have a workbook with VBA code that automatically refreshes the workbook every second. I start and stop the auto refresh with a macro.

I'm looking for a way to count (+1) every time the refresh happens.

Anyone have anyway of doing this?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
The issue I see is that each time the code is run the count value resets to "Empty".
You could set a cell somewhere out of the way with a Value of 0

Then within you counting code after it refreshes:

Code:
i = Range("A1").Value 'whatever cell reference you want to use
i = i + 1 'adds 1
Range("A1").Value = i 'changes cell value for next count

Your cell would contain the value of the number of refreshes, and the number wouldn't reset after each subsequent run.

Unfortunately, the number in that cell will grow sequentially and never reset to 0 unless you do it manually.

Someone else may be able to give you more help if you need something further.
 
Upvote 0

Forum statistics

Threads
1,203,754
Messages
6,057,156
Members
444,908
Latest member
Jayrey

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