Macros to add numbers

Closed
Koushik - Jul 21, 2015 at 07:06 PM
vcoolio Posts 1409 Registration date Thursday July 24, 2014 Status Moderator Last seen May 23, 2024 - Jul 22, 2015 at 12:18 AM
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
Related:

1 response

vcoolio Posts 1409 Registration date Thursday July 24, 2014 Status Moderator Last seen May 23, 2024 262
Jul 22, 2015 at 12:18 AM
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.