![]() |
|
#1
|
|||
|
|||
![]()
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 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. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Formatting contents after Tab of continuous lines or formatting specific area of word | pawii | Word | 1 | 05-12-2014 05:24 AM |
macros | stebrownsword | Word VBA | 0 | 08-28-2013 01:16 AM |
![]() |
anju16saini | Word VBA | 1 | 03-11-2013 04:15 AM |
![]() |
WaltR | Word VBA | 8 | 05-15-2012 06:28 PM |
Macros | nore | Outlook | 0 | 06-01-2011 04:39 PM |