+ Reply to Thread
Results 1 to 4 of 4

How Do I Replace The Last Character Of A String In A Macro?

  1. #1
    Registered User
    Join Date
    04-24-2012
    Location
    San Francisco, USA
    MS-Off Ver
    Excel 2007
    Posts
    60

    How Do I Replace The Last Character Of A String In A Macro?

    Hi guys

    Im sure this is pretty easy but if i have the string:

    "Dining Tables, Dining Room Seating,"

    How do i turn it into the following:

    "Dining Tables, Dining Room Seating and more."

    thanks

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: How Do I Replace The Last Character Of A String In A Macro?

    Let say Dining Tables, Dining Room Seating is in A1.

    In B1, =A1&" "&"and more."

    If you must have a macro...

    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 06-07-2012 at 06:37 PM.
    HTH
    Regards, Jeff

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How Do I Replace The Last Character Of A String In A Macro?

    You need to remove the final comma before appending the text.

    =LEFT(TRIM(A1),LEN(TRIM(A1))-1)&" and more"

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    04-24-2012
    Location
    San Francisco, USA
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: How Do I Replace The Last Character Of A String In A Macro?

    thanks, works great!

+ 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