How to apply a constant throughout a worksheet

  • Thread starter Thread starter dysert
  • Start date Start date
D

dysert

I have a worksheet (or even just a single row or column) to which I wan
to apply a constant to every cell (e.g., add a 5 to all selecte
cells). Does anyone know of a quick way to do this (obviously withou
writing a "=a1+5" formula and moving it around for the entir
worksheet)? Thanks
 
Hi

Type 5 into an unused cell. Copy it. (Ctrl C)
Select the range you wish to add it to.
Edit / Paste Special / Add

Hope this helps.

Andy.
 
Hi Dysert

Type 5 in a empty cell
Copy that cell

Select the cells
Right click on them and choose Paste Special
Check add
Ok
 
You could type 5 into a cell, press ENTER
Copy the Cell, select your range, then Edit, Paste Special, Add


Alternatively, a macro (you OK with these?):

'Select your range first, then run the following code:

Sub AddConstant
Dim myValue as long, Cel as range
myValue=5
for each Cel in Selection
cel.value = cel.value + myValue
next cel
End sub
 
Thank you all very much! Here I thought I was an Excel wizard and
something so simple had me stumped. Thanks again!
 
Back
Top