I'm trying to come up with code and keep the same type of method consistent with the spreadsheet that I inherited.
All I want to accomplish is that if someone types something in a cell and it has spaces on the front end or back end of whatever they typed, the space is removed immediately (after they select another cell)
This is where I thought it was most logical to Trim the spaces, but it's just not happening on Dates etc.
Can anyone tell me what I'm missing or doing wrong?:
THANKS IN ADVANCE!
All I want to accomplish is that if someone types something in a cell and it has spaces on the front end or back end of whatever they typed, the space is removed immediately (after they select another cell)
This is where I thought it was most logical to Trim the spaces, but it's just not happening on Dates etc.
Can anyone tell me what I'm missing or doing wrong?:
Code:
For Each oCell In Target
oCell.Value = Validations.CleanNonStndChars(CStr(oCell.Value))
oCell.Value = WorksheetFunction.Trim(CStr(oCell.Value))
Next oCell
THANKS IN ADVANCE!