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: 40
Default Conditional Formatting Strangeness

I'm working from an Access database to conditionally format cells in Excel.
Here's a snippet of my code. I don't pretend to understand how some of it
works, it was kindly supplied by Bernie Deitrick.

Set objRange = objXL.Intersect(objSht.Range("K2:IV65536"),
objSht.UsedRange) 'Start from Row 2
With objRange
.Select
.FormatConditions.Delete
.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess,
Formula1:="=" & .Cells(1, 0).Address(False, False)
.FormatConditions(1).Interior.ColorIndex = 3 'Conditionally
format cells red
.FormatConditions.Add Type:=xlCellValue,
Operator:=xlGreater, Formula1:="=" & .Cells(1, 0).Address(False, False)
.FormatConditions(2).Interior.ColorIndex = 4 'Conditionally
format cells red
End With

When I manually select cell K2 in Excel and look up the conditional
formatting it references cell T2 instead of cell J2. That just happens to
be an offset of 10. I'm *sure* this code used to work but I can't for the
life of me work out why it's behaving this way. Any clues anyone?

Many thanks.

Keith.

 
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 formatting strangeness Allenx Excel Worksheet Functions 0 March 14th 07 02:58 PM
Conditional formatting strangeness duncan79 Excel Discussion (Misc queries) 5 May 18th 06 05:02 AM
Conditional formatting strangeness christopherp Excel Discussion (Misc queries) 13 March 6th 06 12:51 PM
ByRef strangeness Nicklas Karlsson Excel Programming 2 October 17th 04 07:36 PM
More HpageBreaks Strangeness BillzyBop Excel Programming 0 June 23rd 04 03:40 AM


All times are GMT +1. The time now is 06:38 PM.

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"