View Single Post
 
Old 06-25-2014, 06:26 AM
EC37 EC37 is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: May 2014
Location: Waltham, MA
Posts: 56
EC37 is on a distinguished road
Default

I've got it!

I set everything up properly this time. I went with the following:

Code:
 
cc = Range("L1").End(xlDown).Row
Set org = Range("A2:L" & cc)
 org.EntireColumn.autofit
 org.FormatConditions.Add Type:=xlExpression, Formula1:="=$B2=1"
 org.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
  With org.FormatConditions(1).Font
   .Strikethrough = False
   .ThemeColor = xlThemeColorDark1
   .TintAndShade = -0.349986266670736
  End With
org.FormatConditions(1).StopIfTrue = False
I tried your "RC2=1" suggestion, but it did not recognize it.
Anywho- You'll see that I had to specify the Range for org to be A2 rather than A1. Somehow, in doing this, it was affecting the results of the conditional formatting. I troubleshooted by running the macro, and then referring to the Conditional Formatting- as if I intended to set it up manually- and reviewed what the macro did exactly.
It set it up just as we told it to via code. So the Rule appeared as:
Formula: =$B2=1 | Applies to: =$A$1:$L$264 (or L1.End(xlDown)).

But, when compared to how I recall setting it up previously- I was selecting only the area containing the information- i.e. less the header row. So it should have appeared as =$A$2:$L$264.
I manually edited it to appear as such to see if it would correct the formatting- but it didn't. I opened up the rules again to have another look, and noticed, by changing it to $A$2, it then changed my Formula to =$B3=1. So, I edited it back to $B2, hit apply and presto magnifico- it worked.

So, I started over. Pasted the timeline back into Excel, and reran the macro with my new edits- changing org to be Range("A2:L" & cc). And it works perfectly now.

I literally tried changing things several times before i even thought to just review what the macro set up for the conditional formatting rule and make sure it appears exactly as I expected it to. Troubleshooting for myself, helps me to understand what I'm doing wrong- unless I am stumped and then I must call on the master known as Bob Bridges!

Thanks again. I think you may be able to finally set our 4 page 50+ post thread to 'SOLVED' lol.

Last edited by EC37; 06-25-2014 at 07:54 AM.
Reply With Quote