Hi,
The situation that I am facing is that identifiers that are entered into a column are used to search a database and display data in other columns. However, when a number is entered that starts with a zero, excel automatically truncates the number to omit the zeros.
I am attempting to use a trigger so that once a number is entered into a cell and a different cell is selected, excel will 'force' the cell to remain the same, if that makes sense. I'm not sure if this would be accomplished by storing it as a text or another method, and I have very little experience with VBA so any input would be appreciated. The basic code that is in place right now is as follows:
Private Sub Worksheet_Change(ByVal Target As Range)
'MsgBox Target.Value
Application.EnableEvents = False
Target.Value = Target.Value & " please help"
Application.EnableEvents = True
End Sub
This was set up by another coworker and just adds "please help" to any cell that is changed. Is it possible to add a ' before the value in the cell so that the number starting with zero would be stored as text and remain the same?
The situation that I am facing is that identifiers that are entered into a column are used to search a database and display data in other columns. However, when a number is entered that starts with a zero, excel automatically truncates the number to omit the zeros.
I am attempting to use a trigger so that once a number is entered into a cell and a different cell is selected, excel will 'force' the cell to remain the same, if that makes sense. I'm not sure if this would be accomplished by storing it as a text or another method, and I have very little experience with VBA so any input would be appreciated. The basic code that is in place right now is as follows:
Private Sub Worksheet_Change(ByVal Target As Range)
'MsgBox Target.Value
Application.EnableEvents = False
Target.Value = Target.Value & " please help"
Application.EnableEvents = True
End Sub
This was set up by another coworker and just adds "please help" to any cell that is changed. Is it possible to add a ' before the value in the cell so that the number starting with zero would be stored as text and remain the same?