Jo Helge Rorvik
New Member
- Joined
- Mar 23, 2023
- Messages
- 11
- Office Version
- 365
Hi!
I'm new in this world, but have programmed for a while
The problem is that I want to format my TextBox such that it work for currency.
I've Tried this:
Private Sub UserForm_Activate()
Me.tb_Amount = Format(Me.tb_Amount, "$ #,##0.00")
End Sub
Private Sub tb_Amount_AfterUpdate()
If IsNumeric(Me.tb_Amount) Then
Me.tb_Amount = Format(Me.tb_Amount, "$ #,##0.00")
Else: Me.tb_Amount = ""
End If
End Sub
-The first I wonder is do I have to add something in the textbox to get .00 'The last 2 digits??
in UserForm_Activate
-The second AfterUpdate, the cursor jumps to the end of field, which means that I have to
use the arrows to get back to my focus point. Is there a way to select the position to cursor??
Do you get what I mean?
Thanks a lot for a great site..
Jo-Helge
I'm new in this world, but have programmed for a while
The problem is that I want to format my TextBox such that it work for currency.
I've Tried this:
Private Sub UserForm_Activate()
Me.tb_Amount = Format(Me.tb_Amount, "$ #,##0.00")
End Sub
Private Sub tb_Amount_AfterUpdate()
If IsNumeric(Me.tb_Amount) Then
Me.tb_Amount = Format(Me.tb_Amount, "$ #,##0.00")
Else: Me.tb_Amount = ""
End If
End Sub
-The first I wonder is do I have to add something in the textbox to get .00 'The last 2 digits??
in UserForm_Activate
-The second AfterUpdate, the cursor jumps to the end of field, which means that I have to
use the arrows to get back to my focus point. Is there a way to select the position to cursor??
Do you get what I mean?
Thanks a lot for a great site..
Jo-Helge