Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-25-2014, 06:26 AM
EC37 EC37 is offline NEWB to Macros - formatting exports Windows 7 64bit NEWB to Macros - formatting exports Office 2010 64bit
Advanced Beginner
NEWB to Macros - formatting exports
 
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
Reply



Similar Threads
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
NEWB to Macros - formatting exports How to do Formatting Using Macros anju16saini Word VBA 1 03-11-2013 04:15 AM
NEWB to Macros - formatting exports Formatting with macros WaltR Word VBA 8 05-15-2012 06:28 PM
Macros nore Outlook 0 06-01-2011 04:39 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft