0% found this document useful (0 votes)
27 views

Userform Textbox With Decimals

This document discusses automatically changing commas to periods in a textbox when the user enters decimal values. It provides VBA code to run when the textbox value changes that uses the Replace function to swap any commas for periods in the textbox value. This allows the textbox to properly handle decimal numbers regardless of the separator used by the user.
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Userform Textbox With Decimals

This document discusses automatically changing commas to periods in a textbox when the user enters decimal values. It provides VBA code to run when the textbox value changes that uses the Replace function to swap any commas for periods in the textbox value. This allows the textbox to properly handle decimal numbers regardless of the separator used by the user.
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Userform Textbox With Decimals

Originally Posted by asskildt

Alternatively, automatically change "," to "."?


This should do the trick:
VB:
Private Sub TextBox1_Change()
Me.TextBox1.Value = Replace(Me.TextBox1.Value, ",", ".", 1, -1, vbTextCompare)
End Sub

You might also like