+ Reply to Thread
Results 1 to 18 of 18

Add " ..." to end of string

  1. #1
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Add " ..." to end of string

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This is basically the idea of what I need done in VBA.

    Essentially, I have cells O4 through O34 with text in them. If the text exceeds 18 characters, I want the 3 dots to be placed at the end of the 15th character in the cell. This way at quick glance I can see that there is more text in there, then I can click on it and read the entire text in the function bar above. The problem, obviously, is that I cannot have this formula/function in the same cell as where I will be typing the text. For the above formula, I have it in another cell just to be tested, and it works good. If I can have the same formula/function written in VBA (I think), this would solve that problem.

    I have attached the file for reference.

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,588

    Re: Add " ..." to end of string

    One way
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Add " ..." to end of string

    I will try this... Do I add a Module? Or do I put this code in the "Sheet 1" in the Excel Objects list?

    Thank you!

    Okay, I put it in a "Module" and what happened was it literally CHANGED the text in the cell to "Taxi, Floppies, …"
    - What I want is it to just show me in the cell "Taxi, Floppies, …", but when I look in the formula bar, it will show me the entire text string: "Taxi, Floppies, Taxi back from floppies"

    Thanks again!
    Last edited by nkitchen31; 01-27-2013 at 04:27 AM.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,588

    Re: Add " ..." to end of string

    ?

    What do you really want to do?

    Do you want to place the formula?

  5. #5
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Add " ..." to end of string

    If you look at the spreadsheet I attached: Find O20. Notice how the text is longer than the width of the cell. What I want is after the 15th or so character to show "..." at the end. This way, at quick glance I can see that there is more in that cell. (So it would look like O21). But when I click on the cell, I want to be able to see the entire text in the "formula bar". The code you gave me literally changes the text to "Taxi, Floppies, ..." so it basically deleted everything after the "...", which is not what I want. Does this make sense now?

    Thank you,
    Nick
    Attached Files Attached Files
    Last edited by nkitchen31; 01-27-2013 at 05:32 AM. Reason: attached new xls

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,588

    Re: Add " ..." to end of string

    OK, now I understand, however, I don't think it is possible.

    Keeping value of full length of the string while appears in cell as different contents.
    If someone can come up with the special cell formatting, I'd like to see it, too....

  7. #7
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Add " ..." to end of string

    Okay, well thank you for your time and help.

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Add " ..." to end of string

    Why not just use conditional formatting?
    Range O15:O33
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Format
    Your choice of cell colour.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  9. #9
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Add " ..." to end of string

    Marcol... I wish it was that easy... That's where I started earlier today. Problem is, I can change the "format" to custom and do @ "..." but it adds it to the very end of the text, which is hidden in the cell so you can't see it anyway. What I need it to add the "..." after like the 10th character.

    This is where I stand now:

    In Conditional I have this: =IF(LEN($O$3)>15, (LEFT($O$3,10) & " …"), $O$3) and the custom format of @ "..."

    That isn't working... HOWEVER, this works: =LEN($O$3)>15 in the condition, and under the custom format I have "..." @
    That is better than nothing.. the dots are placed in front of the text, which works, but I'd prefer to have the "..." after the 10th character.

    So, technically jindon, the cell is showing different text than the formula bar is showing.

    Please see new xls attached for reference. Look at the January 2013 sheet cells O3 and O4

    Thanks!
    Attached Files Attached Files

  10. #10
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Add " ..." to end of string

    I'm totally lost with your logic ...

    If you use the C/F I suggested as the first condition, and use say, "yellow", as the cell colour, then ...
    This way, at quick glance (you) can see that there is more in that cell.
    This works regardless of column width.

    Then if you select any yellow cell you will see exactly what is in the cell in the formula bar.
    But when I click on the cell, I want to be able to see the entire text in the "formula bar".
    Why would you want to do/see anything different?

    What am i missing?

  11. #11
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Add " ..." to end of string

    Because I don't want to change the cell color or font color... I want to add three dots to the end of 10th character in the cell. Almost acting like the [More...] function with wordpress or something.

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,588

    Re: Add " ..." to end of string

    Alternatively, you could use Comments...

  13. #13
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Add " ..." to end of string

    I'm getting somewhere.. in the conditional formula I used =LEN($O$4)>15

    and in the Format Cells under Number, Custom, Type I have:

    _____________ "..." _____________) @

    Now the entire cell is blank except for ... in the middle of the cell. When I click the cell, in the formula bar, it shows my original text. I'm certain there is a way to add the ... after the 10th character. I'm on a mission now!

  14. #14
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Add " ..." to end of string

    jindon:

    This is for you. I didn't quite figure out exactly what I was trying to do, however - this is as close as I'm going to get today I think. I think you'll like it since you wanted to see a cell text different than the formula bar shows.

    OK, now I understand, however, I don't think it is possible.

    Keeping value of full length of the string while appears in cell as different contents.
    If someone can come up with the special cell formatting, I'd like to see it, too....
    Please see attached... Look at the column O, specifically O19... now click on it.
    Attached Files Attached Files

  15. #15
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,588

    Re: Add " ..." to end of string

    O19?

    If you clear P19...

  16. #16
    Forum Contributor
    Join Date
    04-09-2010
    Location
    Fort Myers, FL
    MS-Off Ver
    Excel for MAC
    Posts
    146

    Re: Add " ..." to end of string

    Sorry, I uploaded the wrong one... here it is now.

    If there is ever anything in O column, P will NEVER be empty. My point is, if you look at O19, it says "More Receipts..." but if you CLICK on the actual cell, look in the formula bar.. it says "Taxi, Floppies, Taxi to get floppies, Taxi after floppies"
    Attached Files Attached Files

  17. #17
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,588

    Re: Add " ..." to end of string

    Hummmm

    Should be OK, if you are happy with it...

  18. #18
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Add " ..." to end of string

    See if this in the Workbook Module gives you some more ideas
    Please Login or Register  to view this content.

+ 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