Increment a selection of cells

  • Thread starter Thread starter Michael Finney
  • Start date Start date
M

Michael Finney

How do I select a series of cells in a column and
increment them by 1

I want to take the value in a selected cell, increment the
value, and put the new value back into the cell.
The cell is to just hold an integer.

Thanks.
 
Michael

This macro will add 1 to each cell in your selection. How to select them is
up to you, or post back with criteria for selecting.

Sub AddOne()
Dim cel As Range
For Each cel In Selection
If IsNumeric(cel) Then
cel.Value = cel.Value + 1
End If
Next
End Sub

Gord Dibben Excel MVP XL2002
 
Michael,

An alternative solution.

Put a value of 1 into a separate cell, and then copy that cell to the
clipboard.

Select the cells that you want to increment, and then goto menu
Edit>PasteSpecial and select Values in the Paste options and Add in the
Operation options.
 
Back
Top