+ Reply to Thread
Results 1 to 5 of 5

Concatenate () to value

  1. #1
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Iowa
    MS-Off Ver
    2007
    Posts
    212

    Concatenate () to value

    This likely isn't that difficult, but I'm not getting the expected result. When the user enters a quantity in a form textbox, I would like the
    resulting value be wrapped in parentheses on the worksheet.

    Please Login or Register  to view this content.
    So this should result in (2), or whatever quantity they enter. What I'm getting with this line of code as shown is -2 without ()

    Thank You

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,858

    Re: Concatenate () to value

    Another example of how Excel tries to help us and hurts us instead. What is happening is that Excel is seeing (2) as an accounting type value that represents -2, so it is reinterpreting the entry as -2. The solution here is to figure out some way to get Excel to see this entry as text rather than a number.

    I do not have a lot of experience with getting Excel to treat inputs as text rather than number. My first thought is to preformat this cell as text (numberformat="@") and hope that will be enough to prevent Excel from interpreting this as a -2. You could also try adding an apostrophe to the front of the string, which should signal to Excel that this is a text string and not a number. There may be other strategies, too.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Iowa
    MS-Off Ver
    2007
    Posts
    212

    Re: Concatenate () to value

    Thank you Mr
    I tried setting the cells to "text", it did get rid of the negative sign but didn't add the ().
    It did override the center text setting and placed the result left aligned. Maybe I need to hardcode the text type

  4. #4
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Concatenate () to value

    if you just want it to display correctly you can add the ' before it

    Please Login or Register  to view this content.
    *edited to remove my teststuff
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  5. #5
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Iowa
    MS-Off Ver
    2007
    Posts
    212

    Re: Concatenate () to value

    Thank you, adding the apostrophe lets it work correctly.

+ 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. Auto concatenate and reverse concatenate & Remove duplicates .
    By Andy308 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2016, 12:38 PM
  2. Replies: 3
    Last Post: 07-28-2016, 01:47 AM
  3. Concatenate with Double Info in Concatenate Cell
    By MRoz in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-10-2015, 02:07 PM
  4. Replies: 5
    Last Post: 08-28-2014, 06:01 PM
  5. [SOLVED] VBA concatenate script does not excute as expected, Concatenate and "&" can't be dragged
    By VBAlex in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2014, 09:25 AM
  6. Replies: 2
    Last Post: 04-12-2010, 12:35 PM
  7. [SOLVED] I know how to concatenate ,can one de-concatenate to split date?
    By QUICK BOOKS PROBLEM- in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-26-2005, 01:05 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