Hello: I have the following data. I want col A to equal the value of the first cell to its right, but retain it in a formula. For example the successful result in A2 would be "=B2" not "1". The following code gets the value in col A but it's a value, not a formula. Thank you!
<tbody>
</tbody>
A | B | C | D |
1 | 1 | ||
2 | 2 | ||
3 | 3 |
<tbody>
</tbody>
Code:
Sub temp()
Dim i As Long
For i = 2 To 4
Cells(i, 1).Formula = Cells(i, 1).End(xlToRight).Value
Next i
End Sub
Last edited: