sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,421
- Office Version
- 2016
- Platform
- Windows
I'm using this to loop through a series of Textboxes on a Userform and enter a decimal point after the first 2 numbers entered;
I need something similar now - what I need is for it to add the decimal point before the last 2 numbers, regardless of how many are entered, (although I have limited the Textboxes to a maximum of 6 characters).
Some examples of what I'd expect to see:
Anyone?
Code:
Dim ctrl As MSForms.controlFor Each ctrl In Controls
If ctrl.Name Like "TextSTime*" Then
If Len(ctrl.Value) = 3 Then ctrl.Value = Left(ctrl.Value, 2) & "." & Right(ctrl.Value, 1)
End If
Next
I need something similar now - what I need is for it to add the decimal point before the last 2 numbers, regardless of how many are entered, (although I have limited the Textboxes to a maximum of 6 characters).
Some examples of what I'd expect to see:
101.98
91.45
8.73
Anyone?