+ Reply to Thread
Results 1 to 5 of 5

Adding figures in userform textbox formatted as Euro

  1. #1
    Registered User
    Join Date
    05-11-2015
    Location
    West Cornwall, UK
    MS-Off Ver
    2010
    Posts
    55

    Adding figures in userform textbox formatted as Euro

    Using VBA I can I add the values of 2 userform textboxes if they are formatted with the Pound (£) sign, BUT, I can not get it to add 2 textboxes if they are formatted with the Euro (€) sign.
    txtGB1 = Format(txtGB1, "£ #,##0.00")
    txtGB2 = Format(txtGB2, "£ #,##0.00")

    txtFrench1 = Format(txtFrench1, "€ #,##0.00")
    txtFrench2 = Format(txtFrench2, "€ #,##0.00")

    SO, this works

    Please Login or Register  to view this content.
    But this does not,

    Please Login or Register  to view this content.
    If I remove the Euro (€) sign, it adds correctly.

    Thanks for looking.

  2. #2
    Valued Forum Contributor Gatti's Avatar
    Join Date
    06-08-2015
    Location
    Brasil, São Paulo, Ribeirão Preto
    MS-Off Ver
    365
    Posts
    346

    Re: Adding figures in userform textbox formatted as Euro

    Use the Chr function

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-11-2015
    Location
    West Cornwall, UK
    MS-Off Ver
    2010
    Posts
    55

    Re: Adding figures in userform textbox formatted as Euro

    Thank you for a quick reply.

    This did indeed format the textbox with the Euro symbol.

    I failed to mention that I have a check on data entry to ensure that only a number is entered.

    Please Login or Register  to view this content.
    so this is now my stumbling block, it dosen't see the Chr(128) as a numberic but it does see the £ as numeric.

    Tina

  4. #4
    Valued Forum Contributor Gatti's Avatar
    Join Date
    06-08-2015
    Location
    Brasil, São Paulo, Ribeirão Preto
    MS-Off Ver
    365
    Posts
    346

    Re: Adding figures in userform textbox formatted as Euro

    How about doing this validation before adding Chr and putting it into Textbox? Is that possible?

    Or you can just do:

    Please Login or Register  to view this content.
    Last edited by Gatti; 01-06-2016 at 09:31 AM.

  5. #5
    Registered User
    Join Date
    05-11-2015
    Location
    West Cornwall, UK
    MS-Off Ver
    2010
    Posts
    55

    Re: Adding figures in userform textbox formatted as Euro

    I tried the code you suggested, but got stuck in a loop and ended up with many many Euro symbols.

    I can't see where I could do the validation before adding the Chr as I want to check that only a number is entered into the text box, thats why I have a "change" event.

    Tina

+ 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. Adding figures in userform textbox formatted as Euro
    By TG58 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-06-2016, 08:49 AM
  2. Calculating/adding userform textbox values based on combobox selection and display to cell
    By SpreadsheetGirl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2015, 08:57 AM
  3. Replies: 23
    Last Post: 07-12-2014, 07:09 PM
  4. [SOLVED] Userform textbox value result formatted for date
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-29-2013, 03:28 PM
  5. Userform Textbox updating a another userform textbox (im stuck!!)
    By wapwap in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-31-2011, 02:56 PM
  6. adding consecutive number to userform textbox
    By jsmity in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-10-2008, 09:04 AM
  7. [SOLVED] Euro symbol not appearing when formatted to do so
    By liz in forum Excel General
    Replies: 7
    Last Post: 09-12-2005, 06:05 AM

Tags for this Thread

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