Hello,
Could someone kindly help me complete this procedure please. I have set a variable to the ActiveCell and I wish to pick up the cell reference (eg E3) rather than the value.
The procedure below works but brings back the value rather than reference. So the cell formula will look like =80-C3 instead of =E3-C3 (examples)
Sub ServiceHistory()
Dim LastCell As Range
Range("B3").Select
ActiveCell.Offset(0, 1).Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(0, 1).Select
Loop
ActiveCell.Offset(0, -2).Select
Set LastCell = ActiveCell
Range("B3").Select
ActiveCell.Formula = "=" & LastCell & "-RC[+1]"
End Sub
Could someone kindly help me complete this procedure please. I have set a variable to the ActiveCell and I wish to pick up the cell reference (eg E3) rather than the value.
The procedure below works but brings back the value rather than reference. So the cell formula will look like =80-C3 instead of =E3-C3 (examples)
Sub ServiceHistory()
Dim LastCell As Range
Range("B3").Select
ActiveCell.Offset(0, 1).Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(0, 1).Select
Loop
ActiveCell.Offset(0, -2).Select
Set LastCell = ActiveCell
Range("B3").Select
ActiveCell.Formula = "=" & LastCell & "-RC[+1]"
End Sub