Av8tordude
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 1,075
- Office Version
- 2019
- Platform
- Windows
I have this code that allows the user to just type numbers in the textbox to avoid typing in the wrong format. I would like to know is this could be set up to allow for typing in a ratio. (i.e. 2:1, 10:1, etc.) so the user avoids typing in the wrong format. The number "1" should always be be constant. Can anyone assist. Thanks
Code:
Dim v As String
Select Case Len(tbInv)
Case 1
tbInv = Format(tbInv, "$0\.00")
Case Is > 1
v = Replace(tbInv, "$", "")
v = Replace(v, ".", "")
tbInv = Format(CCur(v) / 100, "$#,#0.00")
Case Else
End Select