Macros to add numbers

[Closed]
Report
-
Posts
1311
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
July 28, 2021
-
Hello,

I need to create a button and on every click of that button it should add 1 to it.
For Eg first click it should take data as 1 and second click it should add 1 to the previous 1 and cont with third click it should add 1 to the previous 2. Kindly help me how to create this.

Thanks,
Koushik

1 reply

Posts
1311
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
July 28, 2021
232
Hello Koushik,

I'm not sure if you have an existing macro to add this to or if you just want one to run on its own to increment the number in a cell but this may help:-

Sub AddIt()
Range("B4").Value = Range("B4").Value + 1
End Sub


Have a look at the following link to see it work:-

https://www.dropbox.com/s/fcizx2767c6drx9/Koushik.xlsm?dl=0

You may have to change the cell references to suit yourself.

I hope that this helps.

Cheerio,
vcoolio.

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!