LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
JP JP is offline
external usenet poster
 
Posts: 103
Default Conditional Formatting macro: simple, but doesn't work

Conditional Formatting macro: simple, but doesn't work. Using Excel 2007
with Windows 7.

Enter the number 1 in cell A1 and the number 2 in cell B1.

Start the macro recorder.
Select A1:B1.
Click Conditional Formatting, New Rule, Use a formula.
Enter: =$a1<$a2, Format, Border, select a continuous bottom border, OK, OK.
Select cell B1 (only).
Click Conditional Formatting, New Rule, Use a formula.
Enter: =B1<C1, Format, Font, Color, select red, OK, OK.
Stop the macro recorder.

Everything looks perfect with a line under cells A1:B1 and red font in cell
B1 (only).

Click Conditional Formatting, Clear Rules, Clear Rules from Entire Sheet.
Run the macro.
It does not implement correctly.
The incorrect result is a red font in both cells A1 and B1 rather than just
cell B1.
The text of the macro looks correct yet it insists on applying the font
color to both cells.

I tried modifying the macro, used cell ranges rather than "Selection," and
rearranged the sequence--all to no avail.

(Interestingly, if you reverse the order by first applying the conditional
font color to B1 prior to the conditional bottom border being applied to
A1:B1, the macro returns "Run-time error '1004': Unable to set the LineStyle
property of the Border class.")
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A very simple conditional formatting question Mel[_4_] Excel Discussion (Misc queries) 6 February 17th 09 02:28 AM
SIMPLE VBA MACRO FOR CONDITIONAL FORMATTING FARAZ QURESHI Excel Discussion (Misc queries) 4 July 31st 07 12:10 PM
simple conditional formatting bcamp1973 Excel Discussion (Misc queries) 5 March 10th 06 11:28 PM
Conditional formatting, simple question... Kelly Excel Worksheet Functions 2 March 1st 06 07:31 PM
Conditional formatting--simple question John Wirt Excel Worksheet Functions 4 February 5th 06 07:13 PM


All times are GMT +1. The time now is 11:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"