Sample Data
Column A has numbers. Column B is empty and will be filled by a VBA procedure that doubles the values in column A.
| Cell | Value |
|---|---|
| A1 | 5 |
| A2 | 10 |
| A3 | 15 |
| B1 | |
| B2 | |
| B3 |
Column A has numbers. Column B is empty and will be filled by a VBA procedure that doubles the values in column A.
| Cell | Value |
|---|---|
| A1 | 5 |
| A2 | 10 |
| A3 | 15 |
| B1 | |
| B2 | |
| B3 |
Sub DoubleValues()
Range("B1").Value = Range("A1").Value * 2
Range("B2").Value = Range("A2").Value * 2
Range("B3").Value = Range("A3").Value * 2
End SubA B +-----+-----+ 1 | 5 | | <-- B1 will get A1*2 = 10 +-----+-----+ 2 | 10 | | <-- B2 will get A2*2 = 20 +-----+-----+ 3 | 15 | | <-- B3 will get A3*2 = 30 +-----+-----+
A B +-----+-----+ 1 | 5 | 10 | +-----+-----+ 2 | 10 | 20 | +-----+-----+ 3 | 15 | 30 | +-----+-----+