Increasing the value of the content of cells by one.

D

DB.

I'm using Excel 2003.
I frequently need to increase by one the numerical values within
maybe 20 or 30 cells scattered about a worksheet.
Is there any way (having selected those cells using the mouse and
Ctrl) that I might press a combination of keys ('F' keys or whatever)
that will enable the contents of those 20-30 cells to be changed
instantaneously?

TIA of any replies.
 
D

Dave Peterson

You could do try this:

Put 1 in an empty cell.
Edit|copy that Cell

Select your range of cells to adjust.
Edit|paste special
Click on Values and Add

If I had to do this lots of times, then I'd give those cells a nice name:
Select the 20 (or 30) cells
Type:
MyRangeToAdd
(or something nice)
in the name box (to the left of the formula bar).

Then you can just choose that name from the name box when you want to select
those cells.
 
M

Matt Richardson

    I'm using Excel 2003.
    I frequently need to increase by one the numerical values within
maybe 20 or 30 cells scattered about a worksheet.
    Is there any way (having selected those cells using the mouse and
Ctrl) that I might press a combination of keys ('F' keys or whatever)
that will enable the contents of those 20-30 cells to be changed
instantaneously?

TIA of any replies.

You could try this code and assign it a shortcut key:-

Public Sub IncrementByOne()

Dim c
For Each c In Selection.Cells
c.Value = c.Value + 1
Next

End Sub

HTH
Matt
http://2toria.com
http://teachr.blogspot.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top