Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA currency or percent format object
I have created a UserForm in VBA and would like users to enter currency and
percent values and see them formated as such. I can find only the TextBox object in the Toolbox, which does not display inputs in the desired format. Is there an object somewhere that automatically formats user inputs as currency or percents? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA currency or percent format object
It's going to be something like this:
Private Sub UserForm_Click() If TextBox1.Text < "" Then TextBox1.Text = Format(CDbl(TextBox1.Text), "$#,##0.00") End If If TextBox1.Text < "" Then TextBox1.Text = Format(CVar(TextBox1.Text), "##0.00%") End If On Error Resume Next End Sub HTH, Ryan -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "cwsimmons" wrote: I have created a UserForm in VBA and would like users to enter currency and percent values and see them formated as such. I can find only the TextBox object in the Toolbox, which does not display inputs in the desired format. Is there an object somewhere that automatically formats user inputs as currency or percents? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Concatenating Currency and Percent | Excel Discussion (Misc queries) | |||
TextBox on a userform - format to currency & percent | Excel Discussion (Misc queries) | |||
Same column Percent and Currency | Excel Discussion (Misc queries) | |||
Currency, Percent and Comma Style buttons | Excel Worksheet Functions | |||
Percent Format without Percent Sign | Excel Programming |