# Adding into a Series of Numbers

##### New Member
10 - Example Number

Let's say I have a spreadsheet and I wanted to add cell example "H1" to the entire column of H.

How do I write this in VBA?

The number 10 could change but the 10 would already be added and it could stay that way.

I am confused on how to write this one. Can anyone give me some suggestions?

### Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a \$25,000 loan, 5% annual interest, 60 month loan.
I am sorry, your post is very confusing.
Can you try rephrasing it?

I will try. If you look at the spreadsheet below. What I want to do is take the 10 and add it into every number in that column. So it would add it to all the 3's and they would become 13. Does this help.

 10 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3

<colgroup><col width="64" style="width:48pt" span="3"> <tbody>
</tbody>

OK. Where is this number coming from?
Will it be a cell on a sheet, or an input asked for when a macro is run?

Note, that if it is a cell on your sheet, this can be done very easily without any VBA.
Just highlight the number and click Copy
Then, highlight the whole range you want to paste it to
Then right-click and select Paste Special -> Add -> OK

Last edited:
Here is what a VBA solution would look like, adding the value from K1 to all the cells in column H, down to the last one.
Code:
``````Sub MyCopyMacro()

Dim lastRow As Long

'   Find last row in column H
lastRow = Cells(Rows.Count, "H").End(xlUp).Row

'   Add value from K1 to column H
Range("K1").Copy
Range("H1:H" & lastRow).PasteSpecial Paste:=xlPasteAll, Operation:=xlAdd, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False

End Sub``````
If you are looking for an Input solution, just incorporate the same InputBox methodology we discussed in your other thread.

Replies
3
Views
203
Replies
4
Views
277
Replies
7
Views
171
Replies
4
Views
240
Replies
1
Views
191

1,196,056
Messages
6,013,157
Members
441,751
Latest member
336448

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back