I have various TextBox's on a worksheet and they display as Currency.
The code for them works well, BUT, will not display $20.10. It would appear to me that the zero following the two(2) is the problem. Any other number displays as it should.
I have been fiddling with the code for about 2 weeks now with no joy. I reach out for HELP!
The code (from the web) is as follows.
There may be a better way. (I hope)Private Sub TextBox6_Change() Static Num As Currency Static Change As Boolean On Error Resume Next If Len(TextBox6.Value) = 0 Then Num = Null: Exit Sub Change = Not Change If Change = False Then Exit Sub If Len(TextBox6.Value) <= 1 Then Num = TextBox6.Value / 100 Else Num = CCur(Num & Right(TextBox6.Value, 1)) * 10 End If Debug.Print TextBox6.Value, Num TextBox6.Value = Format(Num, "$#,##0.00") End Sub
Last edited by keenasmustard; 07-23-2011 at 05:09 AM.
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks