+ Reply to Thread
Results 1 to 3 of 3

Problem setting borders by conditional formatting

  1. #1
    Forum Contributor
    Join Date
    09-30-2009
    Location
    Barcelona
    MS-Off Ver
    Excel 2010
    Posts
    274

    Unhappy Problem setting borders by conditional formatting

    hi,

    I want to make excel put a thin line if element in the first column of range changes, a gray hairline if remains the same

    I have the following piece of code
    Please Login or Register  to view this content.
    however when it reaches the " .Weight = xlThin" line comes an error

    Run-time error 1004
    Unable to set the Weight property of the Border Class

    however I have no problem if instead I use conditional formatting for setting font to bold for instance...

    any clues in what is going wrong?

  2. #2
    Forum Contributor
    Join Date
    09-30-2009
    Location
    Barcelona
    MS-Off Ver
    Excel 2010
    Posts
    274

    Unhappy Re: Problem setting borders by conditional formatting

    Quote Originally Posted by bagullo View Post
    hi,

    I want to make excel put a thin line if element in the first column of range changes, a gray hairline if remains the same

    I have the following piece of code
    Please Login or Register  to view this content.
    however when it reaches the " .Weight = xlThin" line comes an error

    Run-time error 1004
    Unable to set the Weight property of the Border Class

    however I have no problem if instead I use conditional formatting for setting font to bold for instance...

    any clues in what is going wrong?
    Oh well, I guess I'll have to learn to live with it...

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Problem setting borders by conditional formatting

    Not all border settings can be used with conditional formatting. In fact, the formatting options that you can apply to a cell and the formatting options that are available for conditional formatting are quite different.

    Conditional formatting will allow only a subset of all possible formatting options. As a rule of thumb: anything that changes the size of the cell will not be allowed as a conditional format.

    Apparently, some border formats fall into this category.

    cheers,

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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