Harsh Kumar
asked on
vba word number formatting a textbox
Hi again experts,
Another quick question, i'm trying to find a way to format a few userform textbox's but no luck its for formatting it incorrect.
this is the code:
The result is this: 7000,0000
when it should be this: 7.000,00
I'm also looking for a way to do it easier, there is a few textboxes that need this format is there an easier way, like simply right the textbox name on a list and it will put the form in them all, something like this:
no clue if this is possible at all but would make it easier and the code would be more clean i guess :)
thank you in advance
Another quick question, i'm trying to find a way to format a few userform textbox's but no luck its for formatting it incorrect.
this is the code:
Private Sub txtvjhjp_AfterUpdate()
txtvjhjp.Text = Format(txtvjhjp.Value, "#.##0,00")
End Sub
The result is this: 7000,0000
when it should be this: 7.000,00
I'm also looking for a way to do it easier, there is a few textboxes that need this format is there an easier way, like simply right the textbox name on a list and it will put the form in them all, something like this:
Private Sub decimalseparator_AfterUpdate()
Format(value, "#.##0,00")
.txtvjhjp
.txtvjhp
.txtabc
End Sub
no clue if this is possible at all but would make it easier and the code would be more clean i guess :)
thank you in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No easy way that I can think of
You can just select all the textboxes together (using the Ctrl key) then just insert the following in the FORMAT property:
#,##0.00
Ron
#,##0.00
Ron
You have to make a translation when coding formats in countries where the decimal symbol is a comma and the thousands separator is a period.
ASKER
IrogSinta - I can't seem to fin that propety, is that in the propeties window?
ASKER
but how about a code for more textboxes using this format?