add specific currency to textbox on userform

abdelfattah

Well-known Member
Joined
May 3, 2019
Messages
965
Office Version
  1. 2010
hello
I try adding specific currency to numbers into textbox i would show the number in textbox like this LYD 120,000.00
this is my try
VBA Code:
Private Sub TextBox1_Change()
With Me.TextBox1
Dim s As Currency
s = LYD
        If IsNumeric(.Value) Then .Value = Format(.Value, "#,##0.00" & s)
    End With
End Sub
 

abdelfattah

Well-known Member
Joined
May 3, 2019
Messages
965
Office Version
  1. 2010
yes it works only when I have more than one textbox but as you see in my userform contain textbox1 not more on user form
 

Some videos you may like

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

abdelfattah

Well-known Member
Joined
May 3, 2019
Messages
965
Office Version
  1. 2010
thanks mohadin your code works excellently i put combobox and select item then populate the number with currency in textbox change event
well done ! buddy (y)
 

mohadin

Well-known Member
Joined
Mar 22, 2015
Messages
933
Office Version
  1. 2013
Platform
  1. Windows
OK, glad you could sort it out
Be happy
 

Watch MrExcel Video

Forum statistics

Threads
1,123,346
Messages
5,601,080
Members
414,426
Latest member
fraru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top