Forum Discussion
IF Statement Concerns
- Apr 24, 2018
Hello,
what you want to achieve cannot be done with the NOW() formula. It will always update to the current date and time. If you want a time stamp that does not change, then you will need to use VBA.
This code will put a time stamp into column B when a cell in column A is changed by the user. Copy the code, then right-click the Sheet, select "View code" and paste the code into the code window.
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("A:A")) Is Nothing Then Target.Offset(0, 1) = Now End If End Sub
Gourab Dasgupta Yes, this is possible, but it can have implications for other aspects of the workbook, where iterative calculation is not desired. Unless the user is absolutely sure what they are doing with this setting, I suggest avoiding this approach.
Hi
You are right, but as per present scenario the user is getting the exact output without need of having knowledge of advance excel. let her go through the solution and wait for the response. we are here to guide.
- Jennifer ClarkApr 24, 2018Copper Contributor
Thank you all, I ended up using the VB Script as that was the only way to ensure that the dates and times didn't change if someone accidentally clicked to calculate the sheet.
- Gourab DasguptaApr 24, 2018Iron ContributorWell done