ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to increase cell value by 1 each time button clicked (https://www.excelbanter.com/excel-programming/296678-macro-increase-cell-value-1-each-time-button-clicked.html)

fozzer[_2_]

Macro to increase cell value by 1 each time button clicked
 
Hi,

does anyone know what code to include in a macro so that a given cel
in increase by 1 each time the macro is run. The macro will b
clearing all of the data fields so that the counter goes on to the nex
data entry i.e data is entered onto quote 23, macro clears all dat
fields and moves on to quote 24 and so on.

Thanks
Pet

--
Message posted from http://www.ExcelForum.com


mudraker[_193_]

Macro to increase cell value by 1 each time button clicked
 
' test cell a1
if isnumeric(range("a1")) then
range("a1").value=range("a1").value+1
end i

--
Message posted from http://www.ExcelForum.com


Don Guillett[_4_]

Macro to increase cell value by 1 each time button clicked
 
does anyone know what code to include in a macro so that a given cell
in increase by 1 each time the macro is run.


Sub addone()'assign to a button
Range("d2") = Range("d2") + 1
End Sub

--
Don Guillett
SalesAid Software

"fozzer " wrote in message
...
Hi,

does anyone know what code to include in a macro so that a given cell
in increase by 1 each time the macro is run. The macro will be
clearing all of the data fields so that the counter goes on to the next
data entry i.e data is entered onto quote 23, macro clears all data
fields and moves on to quote 24 and so on.

Thanks
Pete


---
Message posted from
http://www.ExcelForum.com/





All times are GMT +1. The time now is 04:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com