ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Method to increment value in data field? (https://www.excelbanter.com/excel-discussion-misc-queries/1235-method-increment-value-data-field.html)

Karl H

Method to increment value in data field?
 
It would be helpful while tabulating survey data, to be able to increment a
field value by one-- with the stroke of a "hot key" rather than having to
erase the current value and raise it by one.

Does such a method exist?

PeterAtherton

Karl

You have to use VB

Copy this macro into a module. Press Alt + F11,Insert, Module and then paste
the code

Sub Incr()
Dim c
For Each c In Selection
c.Value = c + 1
Next
End Sub

Press Alt+F8 select the macro and choose OPtions and you can assign a short
cut key to run the macro

Regards
Peter

"Karl H" wrote:

It would be helpful while tabulating survey data, to be able to increment a
field value by one-- with the stroke of a "hot key" rather than having to
erase the current value and raise it by one.

Does such a method exist?



All times are GMT +1. The time now is 05:24 PM.

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