JohnZ1156
Board Regular
- Joined
- Apr 10, 2021
- Messages
- 180
- Office Version
- 2021
- Platform
- Windows
I have a table where I'd like the macro to enter a formula BEFORE I enter the actual value.
I would like it to enter a formula that says, in the activecell, put the formula (offset(0,-1) minus (offset(-1, -1)
Then I would like it to show me that amount.
But then, I have an input box and I'd like whatever I enter into the input box to REPLACE the formula in the activecell.
I would like it to enter a formula that says, in the activecell, put the formula (offset(0,-1) minus (offset(-1, -1)
Then I would like it to show me that amount.
But then, I have an input box and I'd like whatever I enter into the input box to REPLACE the formula in the activecell.
VBA Code:
With ActiveCell
.Offset(0, 0).Value = .Offset(0, -1).Value - .Offset(-1, -1).Value
End With
Trip = InputBox("Please enter the Trip Distance.", "Trip Distance", Default, XPos:=2880, YPos:=5760)
ActiveCell.Value = ActiveCell.Value & Trip
ActiveCell.Offset(0, 1).Select