+ Reply to Thread
Results 1 to 8 of 8

Apply Border based on change in cell value?

  1. #1
    Registered User
    Join Date
    01-10-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Apply Border based on change in cell value?

    I currently have 200 Rows of data with Column H being a value of 1-12. I would like sort by this Column and have an outside border applied to the entire Row when there is change in value in Column H. Problem is, I'm frequenlty adding additional Rows of data so when I re-sort the data by Column H, the border doesn't move. For example, I have a border between Rows 25 and 26 because the value in H has gone from 3 to 4. However, if I add a new Row with a value of 3 in Column H and re-sort, the border stays where it is and now I have a Row with a value of 3 in the "section" of Rows with 4 in Column H (for illustration purposes, the underlined text below represents a border).

    3
    3
    3
    3
    4
    4
    4

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202
    have you tried Conditional Formatting?

    post what you have so far or attach the workbook
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    01-10-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4
    I'm using conditional formatting for another reason already. Attached is an example of the sheet...
    Attached Files Attached Files

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202
    What's the worksheet change code used for?

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202
    See this earlier post

  6. #6
    Registered User
    Join Date
    01-10-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4
    I use conditional formatting to give me the color change, but I'm not seeing how to have the entire row formatted with a border at a change in value (sorry for my ignorance).

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202
    The code in the earlier post needs adapting for your use. It detects a change so all you need is to add code to border the cells instead of adding the date

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

    It seems a working example of the code is what you want. I have added a button to the worksheet to run the macro. The data will be sorted by Team, School, and Gender in ascending order. Separating borders will then be added where the numbers change. Here is the macro code...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross
    Attached Files Attached Files

+ 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