Closed Thread
Results 1 to 6 of 6

How to sort chains and add a string?

  1. #1
    Registered User
    Join Date
    04-14-2011
    Location
    Buford, USA
    MS-Off Ver
    Excel 2007
    Posts
    26

    How to sort chains and add a string?

    What would be code to get columns A and B to look like in columns G and H. So at the beginning of every chain to add BEG, and at the end END.
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: How to sort chains and add a string?

    Hello salso69,

    Welcome to the Forum!

    The macro below will sort the chains as you requested. A button has been added to the worksheet to run the macro.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    04-14-2011
    Location
    Buford, USA
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: How to sort chains and add a string?

    Thank you so much it works!!!
    Can this line be changed to work with any sheet name
    Set Wks = Worksheets("Sheet1")

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: How to sort chains and add a string?

    Hello salaso69,

    To make the macro with any worksheet, change the assignment statement to this...
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-14-2011
    Location
    Buford, USA
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: How to sort chains and add a string?

    What to say, THANK YOU!!!

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,969
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

Closed 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