Macro to increment cell by one

duskwood47

New Member
Joined
Oct 9, 2017
Messages
28
So I need to create a macro that will increment the cell immedietly to the right of the cell that would have a button to increment by one. I know I could a simple

Public Sub AddOne()
Range("C3").Value = Range("C3") + 1
End Sub

to accomplish what I need however I will have around 10 buttons total and dont want a different macro for each one.

Help please!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
You don't even need a macro. You could just insert a Spin button.

If you do not have the Developer tab on your ribbon, click File > Options > Customize Ribbon > and under the Main Tabs box on the right, check Developer.

Select the cell where you want the button, say C2. Now from the Developer tab, click Insert > Form Controls > Spin Button. Use the mouse to create the spin button on the sheet where you want it. Now right click on the spin button and select Format Control. Change minimum value to 1. Change the Cell link to C3 (or wherever you put the counter). Click OK.

Now you can click on the spin button, up or down, and it will increment C3 appropriately.
 
Upvote 0
You don't even need a macro. You could just insert a Spin button.

If you do not have the Developer tab on your ribbon, click File > Options > Customize Ribbon > and under the Main Tabs box on the right, check Developer.

Select the cell where you want the button, say C2. Now from the Developer tab, click Insert > Form Controls > Spin Button. Use the mouse to create the spin button on the sheet where you want it. Now right click on the spin button and select Format Control. Change minimum value to 1. Change the Cell link to C3 (or wherever you put the counter). Click OK.

Now you can click on the spin button, up or down, and it will increment C3 appropriately.
You don't even need a macro. You could just insert a Spin button.

If you do not have the Developer tab on your ribbon, click File > Options > Customize Ribbon > and under the Main Tabs box on the right, check Developer.

Select the cell where you want the button, say C2. Now from the Developer tab, click Insert > Form Controls > Spin Button. Use the mouse to create the spin button on the sheet where you want it. Now right click on the spin button and select Format Control. Change minimum value to 1. Change the Cell link to C3 (or wherever you put the counter). Click OK.

Now you can click on the spin button, up or down, and it will increment C3 appropriately.
 
Upvote 0
Just to let you know that it was extremely useful to me today. Thanks a lot.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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