Is there something equivalent to Cell_Change
Event in VBA
or even VSTO
that would fire BEFORE the user input is committed into the cell? I need to add some checks just before a new value is entered in a cell.
By the time the WorkSheet_Change
event fires, Excel has already modified the user input and converted it into a different value. I need to get the original input that user typed.
EDIT
To be more specific, I want to prevent Excel from converting values like 3E9
, which happens to be a valid (non-numeric/non-scientific) input in my case, to scientific notation.
These values can be input by the user in any cells in the entire worksheet, so I cannot pre-apply Text formatting because that will stop Excel from doing its normal functionality on valid numeric data too.
So I'm planning to:
- somehow grab the input just before it goes into the cell and gets converted.
- then check if it fits the exact pattern I'm watching for and apply Text format on that specific cell on-the-fly.