how ignore currency in textbox when read amount ?

abdelfattah

Well-known Member
Joined
May 3, 2019
Messages
1,429
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
hello
actually I have textbox contains like this LYD 1,324,555.00 the textbox link with lable and function to read amount , but the problem is in currency LYD . the function can't read it because of the currency how I can avoid reading currency to fix the problem ?
by the way the code works if there is no currency in textbox .
here is my code
VBA Code:
Private Sub TextBox49_Change()

TextBox49 = Format(TextBox49, "#,##0.00")
Label47.Caption = " " & "amount only" & " " & _
kh_TextNum(TextBox49, 0, "dinner", "dananner", "only cent,,,", 3, "cents", 1)

With Me.TextBox49
Dim s As String

s = "LYD"
        If IsNumeric(.Value) Then
        .Value = s & " " & Format(CStr(.Value), "#,##0.00")
        End If
    End With

End Sub
thanks
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I thought there was such a textbox property in Excel like there is in Access. Silly me for thinking that M$ Excel and Access program designers would be on the same page when it comes to such common features. Sorry.
 
Upvote 0
@Siddharth Rout

thanks for your notice , but still doesn't treat problem the numberformat

That is because we we are not handling the format in the TextBox49_KeyPress code that I gave ;).

"," is a character. My code doesn't allow charcaters. Only numbers. If you want to allow that you will have to edit the code that I gave and format the numbers accordingly. :)
 
Upvote 0
if you want to allow that you will have to edit the code that I gave and format the numbers accordingly.
I have no idea how do that. I try many times without any result .
 
Upvote 0

Forum statistics

Threads
1,215,479
Messages
6,125,043
Members
449,206
Latest member
Healthydogs

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
Back
Top