+ Reply to Thread
Results 1 to 4 of 4

Textbox to Display Currency

  1. #1
    Registered User
    Join Date
    07-07-2009
    Location
    Wilkie, Saskatchewan
    MS-Off Ver
    Excel 2003
    Posts
    21

    Textbox to Display Currency

    Please Login or Register  to view this content.
    this is the code i am trying to use but the format does not show up if I change the private sub txttarget_format() to private sub txttarget_change the format works but because it is a change it will only let me enter the first digit and not all four digits that i want to enter.
    Last edited by James12; 08-24-2009 at 10:22 PM. Reason: Added Code Tags

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Textbox to Display Currency

    Hi James. Be sure to read through the Forum Rules so you can use and follow them effectively. For instance, you'll need to edit that post above and put code tags around that code you used. (Like I did below...)

    The _change event triggers ANYTIME there is a change, in a textbox it is trying to trigger with every digit you type. You need to arrange the macro so that it first checks if you're done typing. You said 4 digits, so if it's always 4 digits, then something like:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Textbox to Display Currency

    Hello James12,

    You can place the code in the TextBox_AfterUpdate() event of the UserForm. This formats the entry, provided of course numbers were entered, as currency.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    07-07-2009
    Location
    Wilkie, Saskatchewan
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Textbox to Display Currency

    Thanks for all the help both solution worked

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1