Superimpose Data

  • Thread starter Thread starter shternm
  • Start date Start date
S

shternm

I would like to superimpose hardcoded data with a combination of old
data and a formula.
For example, I have hardcoded 1, 2, 3 in three cells. I would like to
add to that +2, so that 1+2 will show 3 and so on. I can't insert
another column/row to calculate this. I want that done without having
to go into each cell make that change but rather drag it across.
My IT says it can't be done.

Please help!
 
Just click in any empty cell on the workbook and enter the number you
want to increment by. After entering the number in the cell, Right
click and copy it. Next, highlight the range of cells that you would
like to have incremented then right-click and choose "Paste Special"
and choose the operation "Add." This will add two to all the values of
each of the cells in the selected range. Is this what you are trying
to accomplish?

Rollin
 
One way

Type the value 2 in a empty cell on your worksheet
Copy this cell
Select the range
Right click on it and choose Paste Special
Check Add and press OK
 
Your IT doesn't have a clue.


If you want, for instance,

A1: 1

to be

A1: 3

then put 2 in an empty cell. Copy the cell. Select your Range.
Choose Edit/Paste Special, and select the Add and Value radio
buttons.

If instead you have

A1 =1

and you want

A1: =(1) + 2

Then put 2 in an empty cell, Copy the cell. Select your Range.
Choose Edit/Paste Special, and select the Add and Formula radio
buttons.


Or if you have

A1: 1
A2: =A1 + 1

and you want

A1: =1 + 2
A2: =(A1 + 1) + 2

This macro will do it:

Public Sub Add2()
Dim cell As Range
For Each cell In Selection
With cell
If .HasFormula Then
.Formula = "=(" & Mid(.Formula, 2) & ")+2"
Else
.Formula = "=" & .Value & "+2"
End If
End With
Next cell
End Sub
 

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

Back
Top