+ Reply to Thread
Results 1 to 4 of 4

Sorting and Borders...

  1. #1
    Registered User
    Join Date
    04-06-2011
    Location
    NY, USA
    MS-Off Ver
    Excel 2003/2007
    Posts
    13

    Sorting and Borders...

    Borders are left where they are when cells are sorted; on the other hand, cell color and font features 'travel' with the data.

    How can I force a cell to maintain its borders in a sort?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,517

    Re: Sorting and Borders...

    Perhaps the cell colour and font are a result of Conditional Formatting.

    This isn't something I've come across. Perhaps you could post a sample workbook.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    04-06-2011
    Location
    NY, USA
    MS-Off Ver
    Excel 2003/2007
    Posts
    13

    Re: Sorting and Borders...

    The issue is not with cell color, font or conditional formatting.

    Maybe it is just the way Excel is...I'm not sure. Let's say you start a blank worksheet and type some numbers in Column A, rows 1 through 5. Then, say, you select A4 and change the border to bold. (You can also use different fonts and colors on the other data).

    When you effect a sort on the column, the numbers are ordered, but A4 remains bordered, even if its value is changed. The other data retain their fonts and colors wherever they go.

    Why all this? I use border styles to highlight data in a sheet that is sorted differently at different times. (I could use color but the printer is a mono laser).

    Is there a way in VB to make a cell retain its border in a sort?

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,517

    Re: Sorting and Borders...

    I can confirm that it behaves exactly as you have stated.

    I wasn't aware of this and I don't know if there's a way to make it behave differently.

    I'm guessing there's an assumption that borders are meant to be in specific places as part of the design of the worksheet and people might be a tiny bit upset if their hard work was undone when they sorted their data.

    Regards

+ 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