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: 586
Default Conditional Formatting Issue

This code is giving me fits and I can't see what the problem is. It is
probably obvious, but I'm so fustrated I can't see it. I am getting an error
below can someone tell me why? I am wanting to highlight every other row.
ERROR: Application Defined or Object Error

Sub ConditionalFormatting()

lngDeptLastRow = .Cells(Rows.Count, "A").End(xlUp).Row
' highlight late dates red
With .Range("L5:L" & lngDeptLastRow)
.FormatConditions.Delete
.FormatConditions.Add Type:=xlCellValue,
Operator:=xlLess, Formula1:="=TODAY()"
.FormatConditions(1).Interior.ColorIndex = 3
End With

' highlight everyother row light green
With .Range("A5:O" & lngDeptLastRow)
ERROR .FormatConditions.Add Type:=xlExpression,
Formula1:="=MOD(ROW(),2)=0"
.FormatConditions(2).Interior.ColorIndex = 35
End With

End Sub
--
Cheers,
Ryan
 
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
Issue with conditional formatting The Rook[_2_] Excel Discussion (Misc queries) 2 June 2nd 10 05:36 PM
Conditional Formatting Issue debra49424 Excel Discussion (Misc queries) 4 February 19th 09 07:10 PM
Conditional Formatting Issue Robert Excel Discussion (Misc queries) 8 September 1st 08 11:05 PM
Conditional Formatting Issue afsoares Excel Discussion (Misc queries) 3 June 30th 06 01:36 PM
conditional formatting issue QUESTION-MARK Excel Worksheet Functions 3 April 20th 06 01:04 AM


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