+ Reply to Thread
Results 1 to 12 of 12

applying diagonal borders to cells with the value "x"

  1. #1
    Registered User
    Join Date
    04-17-2011
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2003 (Work)/Excel 2010 (Home)
    Posts
    6

    applying diagonal borders to cells with the value "x"

    Hey guys, I'm still kinda new to excel programming, but I was hoping you guys could help me with the coding I'll need for my workbook. Here's my problem: I want to set borders with thick-line diagonals to each cell with a cell value of "x". I was hoping to apply this coding to all cells on my worksheet. I tried conditional formatting, but it doesn't let you apply diagonals to each cell. I would really appreciate your help.

    Thank you,
    skr345

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    re: applying diagonal borders to cells with the value "x"

    skr345,

    Welcome to the Excel Forum.


    To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data scrubbed/removed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.

    The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.

    To attach your workbook, scroll down and click on the Go Advanced button, then scroll down and click on the Manage Attachments button.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    re: applying diagonal borders to cells with the value "x"

    This code will search all cells on activesheet. When a cell is found with a value of "x" then that cell is formated with diagonal lines

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-17-2011
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2003 (Work)/Excel 2010 (Home)
    Posts
    6

    re: applying diagonal borders to cells with the value "x"

    Thanks for all the help nimrod. You helped a lot. But, I have another question... How do make my macro automatically run everytime I update one of the cells on my worksheet?

  5. #5
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    re: applying diagonal borders to cells with the value "x"

    Hello skr345:
    Could you please explain the situation in more detail :
    - is the format of cell the cell you're are changing ?
    - do you want the format removed when the "x" is removed ?
    - Do you really want to enter a "X" or do you just want the format placed in the cell ?

  6. #6
    Registered User
    Join Date
    04-17-2011
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2003 (Work)/Excel 2010 (Home)
    Posts
    6

    re: applying diagonal borders to cells with the value "x"

    For every cell that has a value of "x" inside of it, I want that cell to be formatted with the borders. And yes, it would great if there was a way for the format to be removed if the "x" was also removed.

  7. #7
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    re: applying diagonal borders to cells with the value "x"

    Open the attached file and try the following...

    1) Double click on any cell in Column A
    2) Double click the same cell again
    ..
    ..
    1) Double click on any cell in Column B
    2) Double click the same cell again

    ..
    ..
    Is this the sort of thing you're looking for ?
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    04-17-2011
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2003 (Work)/Excel 2010 (Home)
    Posts
    6

    re: applying diagonal borders to cells with the value "x"

    Here's an example of one of my workbooks.
    Last edited by skr345; 04-17-2011 at 09:13 PM.

  9. #9
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    re: applying diagonal borders to cells with the value "x"

    Have you tried the examples I provided you ?

  10. #10
    Registered User
    Join Date
    04-17-2011
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2003 (Work)/Excel 2010 (Home)
    Posts
    6

    re: applying diagonal borders to cells with the value "x"

    Ok, I'll try it. Thanks for all the help nimrod!

  11. #11
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    re: applying diagonal borders to cells with the value "x"

    The attached file has 3 example sheets, in the first two sheet double clicks are utilized in the 3rd sheet you actually type in an x. Please note the "Font Format" of these checkboxes. Each checkbox must have this format so that the macro knows if the "change event" applies to the specific cell.
    Attached Files Attached Files
    Last edited by nimrod; 04-17-2011 at 09:42 PM.

  12. #12
    Registered User
    Join Date
    04-17-2011
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2003 (Work)/Excel 2010 (Home)
    Posts
    6

    [SOLVED] Need help applying diagonal borders to cells with the value "x"

    Wow nimrod! You're the best! Not only did you solve the problem I asked from the excel forum, but you gave me 2 other options to use as an alternative. I'm glad I signed up for excel forum. Thanks!
    Last edited by skr345; 04-18-2011 at 12:29 AM.

+ 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