Results 1 to 6 of 6

VBA Conditional Formatting Works But Won't Apply

Threaded View

daedelous00 VBA Conditional Formatting... 12-07-2012, 08:30 PM
6StringJazzer Re: VBA Conditional... 12-09-2012, 11:08 AM
daedelous00 Re: VBA Conditional... 12-10-2012, 12:28 PM
6StringJazzer Re: VBA Conditional... 12-10-2012, 06:53 PM
daedelous00 Re: VBA Conditional... 12-11-2012, 12:24 PM
daedelous00 Re: VBA Conditional... 12-11-2012, 01:58 PM
  1. #1
    Registered User
    Join Date
    07-13-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    47

    VBA Conditional Formatting Works But Won't Apply

    My conditional formatting works, but won't apply automatically.

    I'm trying to apply a simple conditional format to a column (J), by testing to see if any of the values are contained within the named range "GOOD".

    I am using the below VBA, and it works. The problem is it won't actually apply unless, after the script finishes, I go in to Conditional Formatting Rules Manager, open that specific formatting rule, hit OK, and then hit Apply. Then it works. Why won't it apply by itself?



    (NOTE: I had to hand-jam this formula manually; hopefully there's no typos)


    Formula: copy to clipboard
    Range("J:J").FormatConditions.Add Type:=xlExpression, Formula1:= _
    "=COUNT(SEARCH(GOOD,J1))"
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Font
    .ThemeColor = xlThemeColorDark1
    .TintAndShade = 0.499984740745262
    End With
    Selection.FormatConditions(1).StopIfTrue = False
    Last edited by daedelous00; 12-10-2012 at 12:50 PM.

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