+ Reply to Thread
Results 1 to 3 of 3

recognise text box value as a number then format

  1. #1
    Forum Contributor
    Join Date
    10-07-2015
    Location
    cyprus
    MS-Off Ver
    Microsoft 365
    Posts
    182

    recognise text box value as a number then format

    In a userform framebox I have 85 textboxes.

    Some can have only alphabetical value (xxxxx), some can have a value for ex "16pv063/xxxx" and some are real amount as text for ex "26387230.53".

    In the code, I want
    if the textbox value is 0 or "" then make it invisible (this works)

    if the textbox value is a real amount to format it as a USD number
    for ex, if textbox value is alphanumeric like "16pv063/xxxx" then do nothing
    if textbox value is "26387230.53" then to show it in the textbox as "USD 26,387,230.53"

    herebelow the code. When I test it it shows me "USD 26,387,230.53" in the code but it is not appearing as such in the textbox on the screen which remains "26387230.53"

    Can someone gives me a trick?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: recognise text box value as a number then format

    Try Repainting the form
    Me.Repaint before the End If
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Contributor
    Join Date
    10-07-2015
    Location
    cyprus
    MS-Off Ver
    Microsoft 365
    Posts
    182

    Re: recognise text box value as a number then format

    it works perfect thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 05-26-2016, 05:59 AM
  2. Foruse mula for excell to recognise text as number
    By hethm in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-30-2015, 11:37 AM
  3. [SOLVED] userform date will not recognise uk format dd/mm/yyyy
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 12-18-2012, 05:51 PM
  4. Excel 2007 : Date will not recognise UK format
    By markDuffy in forum Excel General
    Replies: 0
    Last Post: 05-18-2011, 11:27 AM
  5. Excel doesn't recognise date format for use with a macro
    By Mattireland in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2010, 05:52 PM
  6. [SOLVED] excel can no longer recognise format
    By mdavis27 in forum Excel General
    Replies: 0
    Last Post: 07-02-2006, 05:50 PM
  7. Replies: 1
    Last Post: 04-13-2005, 01:22 PM

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