Hi Jasper,
Thank you for your response!
It seems like a simple solution, but it does not seem to work.
I put the code as follows:
Private Sub Workbook_Open()
Application.DecimalSeparator = "."
Application.ThousandsSeparator = ","
Application.UseSystemSeparators = False
End Sub
But when I run a procedure as below (bottom), it triggers my error:
If Not IsNumeric(txtHourMetersSOS1.Value) And txtHourMetersSOS1.Value <> vbNullString Then
I.e., it does not see it as a numeric value.
But, if my systems setting is set to use (.), it does not give this error. Also, if I use the method I used in my first post, I do get to put in either (.) or (,), but the decimal displays as the system decimal (,) and not (.) as per the Workbook_Open event.
Private Sub txtHourMetersSOS1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Not IsNumeric(txtHourMetersSOS1.Value) And txtHourMetersSOS1.Value <> vbNullString Then
MsgBox "Sorry, only numbers allowed"
txtHourMetersSOS1.Value = vbNullString
Cancel = True
Else
If Trim(Me.txtHourMetersSOS1.Value) = "" Then
MsgBox "Please enter a value"
Cancel = True
Else
txtHourMetersSOS1.Value = Format(txtHourMetersSOS1.Value, "#,##0.00")
End If
End If
End Sub
Any ideas?
Bookmarks