This is the strangest thing I've seen excel do in a while, I've got a sheet that I want to know when it was last changed. So I added the code below to an existing On-Change program
When this code is in the macro, whenever I enter a value and press [enter], rather than going to the cell it usually would, it will do one of two things:
1. move down a row as usual but then shoot to the side and select the cell in the B column
2. Move up and select the first cell it could on row 10 that wasn't protected, starting with Row B and then working it's way across.
I've tried changing things up, protecting the cell it's trying to select. It's definitely the copy/Paste bit it doesn't like. I'm okay with it doing that because having that date only change with that certain sheet is pretty important, is there anyway to go to a previous selected cell or any way of having on change it just types the value of today in like Range... = xlTodayValue (I have no idea if anything like this exists) without the copy/paste?
Any help is appreciated.
Best regards,
~Will S
When this code is in the macro, whenever I enter a value and press [enter], rather than going to the cell it usually would, it will do one of two things:
1. move down a row as usual but then shoot to the side and select the cell in the B column
2. Move up and select the first cell it could on row 10 that wasn't protected, starting with Row B and then working it's way across.
Code:
ActiveSheet.Unprotect
Range("B11").Formula = "=TODAY()"
Range("B11").Copy
Range("B10").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B11").Formula = ""
Application.EnableEvents = True
I've tried changing things up, protecting the cell it's trying to select. It's definitely the copy/Paste bit it doesn't like. I'm okay with it doing that because having that date only change with that certain sheet is pretty important, is there anyway to go to a previous selected cell or any way of having on change it just types the value of today in like Range... = xlTodayValue (I have no idea if anything like this exists) without the copy/paste?
Any help is appreciated.
Best regards,
~Will S