Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Conditional Formatting in a For Each Worksheet Loop

I currently have 1 conditional format on all worksheets. I want to add a 2nd
conditional format to all worksheets. This loop does not seem to work. Does
anyone have any ideas why?

Sub CFormat ()

Dim wks As Worksheet

For Each wks in Worksheets
'adds a bottom line to every 5th rows
wks.UsedRange.FormatConditions.Add Type:=xlExpression,
Formula2:="=MOD(ROW(),5)=0"
With wks.UsedRange.FormatConditions(2).Borders(xlBottom )
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With

Next wks

End Sub
Reply
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
Loop/Conditional formatting 3 cells above - More than 3 conditions Rajula Excel Programming 4 October 11th 06 11:20 AM
Subject - Loop/Conditional formatting 3 cells above. - more than 3 Rajula Excel Programming 1 October 9th 06 05:56 PM
Conditional Formatting in For:Next loop - won't work!!! Cumberland[_3_] Excel Programming 3 June 21st 06 01:03 PM
Conditional Formatting in a Loop lost!! Excel Programming 8 October 6th 04 02:43 PM
conditional formatting & a loop lost!! Excel Programming 1 September 27th 04 08:59 PM


All times are GMT +1. The time now is 08:15 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"