Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenating Currency and Percent Shams Excel Discussion (Misc queries) 5 February 16th 10 10:00 PM
TextBox on a userform - format to currency & percent Terry Excel Discussion (Misc queries) 2 September 12th 08 02:46 PM
Same column Percent and Currency Wanna Learn Excel Discussion (Misc queries) 7 November 8th 06 08:35 PM
Currency, Percent and Comma Style buttons Leslie Coover Excel Worksheet Functions 1 January 9th 06 01:02 AM
Percent Format without Percent Sign jstrater Excel Programming 1 April 29th 04 07:28 AM


All times are GMT +1. The time now is 08:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"