Macro to Increment a Cell Value by One

Puppies72

Board Regular
Joined
Mar 29, 2010
Messages
211
Hi all,

I need a macro (which I can assign to a button) to increment the values in a range of cells from AD4:AD204 by 1 but only if the cell is not empty.

Basically I am updating a sheet and some of the cells in that range will be empty until I add data so when I click on my "Update Sheet" button it will increment the values by one for cells with data in and then when I add new data and update those cells will begin their incrementation.

Hope that makes sense

thanks in advance!!
 
Hi

It works for me but please make sure that you amend your array of sheet names to the exact names of the sheets that you want this to process. Make sure no typo's, make sure they are included in quotes.

Please also make sure that you added this to the module in the correct workbook / project. I suspect you may have added it to the wrong one (and perhaps that one is disabled).
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
[h=2]macro to increment a cell value by one, but in another sheet[/h]if A1 in sheet 1 is selected I want to press button (who i assigned the macro) and cell B2 in sheet 2 (for example) increase by one
How can I do?
 
Upvote 0

Forum statistics

Threads
1,216,469
Messages
6,130,802
Members
449,595
Latest member
jhester2010

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