+ Reply to Thread
Results 1 to 10 of 10

Excel sort alphabetically doesn't move cell border

  1. #1
    Forum Contributor Marco-Kun's Avatar
    Join Date
    04-14-2009
    Location
    Holland
    MS-Off Ver
    Dutch:2007
    Posts
    298

    Excel sort alphabetically doesn't move cell border

    I also posted this in the Excel General forum almost a week ago. Not sure if this can be done without VBA, thus the reason I post it here again. http://www.excelforum.com/excel-gene...ll-border.html

    Hello everyone,

    Whenever I sort some data by alphabetical order, the background colors the cells has are being moved accordingly.
    Some cells have borders which aren't moved however. So when the order changes when I want them alphabetical the border doesn't move, meaning another value now has it instead. How can I accomplish this?

    Kind regards,

    Marco

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Excel sort alphabetically doesn't move cell border

    Your question is too vague. Under what criteria do the borders exist? Is it just an outline? Is it around each color?

    Record a macro changing the borders. Then using the LastRow techniques, change the second range to the LastRow variable.
    David
    (*) Reputation points appreciated.

  3. #3
    Forum Contributor Marco-Kun's Avatar
    Join Date
    04-14-2009
    Location
    Holland
    MS-Off Ver
    Dutch:2007
    Posts
    298

    Re: Excel sort alphabetically doesn't move cell border

    Thank you for your reply.

    I mean the borders which are being set with this: http://i838.photobucket.com/albums/z...003Borders.gif

    There is no criteria in the sheet to determine when a border should be around a cell, that's for me to decide.
    I added an example; column B has "a" to "i" as data. The border is on "c". When I alphabetically order the data the border doesn't move with "c", but stays, now being with "g".

    Kind regards,

    Marco
    Attached Files Attached Files

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Excel sort alphabetically doesn't move cell border

    You'll have to search for the border, save item's value, turn the border off, sort the data, search for the item, set the border.

    See what you can put together.

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Excel sort alphabetically doesn't move cell border

    may be use conditional formatting (see example)
    Attached Files Attached Files

  6. #6
    Forum Contributor Marco-Kun's Avatar
    Join Date
    04-14-2009
    Location
    Holland
    MS-Off Ver
    Dutch:2007
    Posts
    298

    Re: Excel sort alphabetically doesn't move cell border

    @nilem
    That indeed would work but there is no actual criteria to determine when a border is needed. It's based on my own criteria (something in real life, if you will), the next day, for example, the border could be removed. So one day "c" could have a border, the next day, it could be removed. But when I order them alphabetically, all existing borders should move with the data it's on before ordering it.

  7. #7
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Excel sort alphabetically doesn't move cell border

    maybe so (with helper column C)
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor Marco-Kun's Avatar
    Join Date
    04-14-2009
    Location
    Holland
    MS-Off Ver
    Dutch:2007
    Posts
    298

    Re: Excel sort alphabetically doesn't move cell border

    That seems to work! Thank you
    What do you mean with "helper column C"?

    Kind regards,

    Marco

  9. #9
    Forum Contributor
    Join Date
    05-05-2009
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010 and 365
    Posts
    113

    Re: Excel sort alphabetically doesn't move cell border

    Post deleted
    Last edited by Cyclops; 04-25-2013 at 10:52 AM. Reason: solved

  10. #10
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Excel sort alphabetically doesn't move cell border

    Quote Originally Posted by Marco-Kun View Post
    ...What do you mean with "helper column C"?
    Cell boundaries are recorded in column C. Then these values ​​are erased.

+ 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