LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Conditional format cell ranges with loop?

I require the ability to conditionally format a rather large range o
cells from a macro and I'm thinking that a loop of some variety woul
be the ticket. However tonight was my first foray into VB so I'm no
all the sure what I'm doing yet, simple as it may be.
So here's the scenario:

PHP code
-------------------
sub macro()
Range("D13").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""x"""
Selection.FormatConditions(1).Font.ColorIndex = xlAutomatic
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNTIF($D$13:$Q$13,""A"")=2"
Selection.FormatConditions(2).Font.ColorIndex = 46
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNTIF($D$13:$Q$13,""A"")=3"
Selection.FormatConditions(3).Font.ColorIndex = 3
 
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
Conditional Format based on date ranges Corey Excel Worksheet Functions 4 July 31st 06 05:36 AM
Loop through ranges hotherps[_30_] Excel Programming 3 February 29th 04 08:35 AM
Loop through ranges columns hotherps[_32_] Excel Programming 1 February 26th 04 10:52 PM
How to loop through all ranges in a worksheet Nanette[_2_] Excel Programming 6 January 12th 04 07:30 PM
loop to name ranges spence[_3_] Excel Programming 1 January 8th 04 05:16 PM


All times are GMT +1. The time now is 07:34 AM.

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

About Us

"It's about Microsoft Excel"