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/1236-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?

JulieD

Hi Karl

you can use a macro to do this and assign the macro to a shortcut key
combination.

choose tools / macro / macros
in the white line type a name for the macro (e.g. inc_one)
and click on the create button
you will be taken to the VBE Window and you'll see something along the lines
of
Sub inc_one()

End Sub

in between these two lines type (or copy & paste)

ActiveCell.Value = ActiveCell.Value + 1

close the VBE Window, using the X at the top right.

now go back into tools / macro / macros, click on your macro and choose
options - here you can set up a short cut key combination (e.g. ctrl & shift
& z)
Click OK and then close using the X

now to increment a value by 1, just use your shortcut key combination.

Hope this helps
Cheers
JulieD



"Karl H" wrote in message
...
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 03:30 PM.

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