I need to know how to show a timestamp in a cell in column D when a cell changes in that same row in column B. I edited this screenshot in paint to show what I mean more easily:
The image
I have a vba script that checks a different sheet for a value which it enters in column B. This happens with the select Worksheet_SelectionChange event so I can't simply add:
Range("D3").Value = Now()
Or something similar like that as it will update every time I select something and I only need it to update when the cell in the B column changes. The value in column B only contains the numbers 0, 1 or 2 btw
Best Answer
This VBA code will do it:
You have to copy the code, go to View -> Macros in Excel, Create a new one (any name is valid) and on the left column double click the worksheet where you want to use it (red flag in the picture) and in the right side, paste the code.
This macro modifies the content of the cell on column D whenever theres a change on the same row on column B. The variable BlockedRow protects the first row because it usually has labels, if you have more than one row of labels changed the variable to 2 or more.
If you need to change the columns, make the change on the variables
WatchedColumn
andTimestampColumn
. (A=1, B=2, C=3, D=4,... and so on).