Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
This query creates a conditional formatting query, the result is inconstant. The query change the values in €˜sOrString some time the column changes and others the row changes. iRowCounter = 5 Do Until Sheets("Control").Range("C" & iRowCounter).Value = "" sOrString = "" For iCounter = 5 To 14 If iCounter < iRowCounter Then sOrString = sOrString & " D" & iRowCounter & " = D" & iCounter & "," End If Next sOrString = Right(sOrString, Len(sOrString) - 1) sOrString = Left(sOrString, Len(sOrString) - 1) Sheets("Control").Range("D" & iRowCounter).FormatConditions.Delete Sheets("Control").Range("D" & iRowCounter).FormatConditions.Add Type:=xlExpression, Formula1:= _ "=NOT(OR(" & sOrString & "))" Sheets("Control").Range("D" & iRowCounter).FormatConditions(1).Interior.ColorInd ex = 4 Sheets("Control").Range("D" & iRowCounter).FormatConditions.Add Type:=xlExpression, Formula1:= _ "=OR(" & sOrString & ")" Sheets("Control").Range("D" & iRowCounter).FormatConditions(2).Interior.ColorInd ex = 3 iRowCounter = iRowCounter + 1 Loop Any ideas on how to fix this |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Import New Database Query (Union Query) in Spreadsheet | Excel Discussion (Misc queries) | |||
Convert hard coded query criteria to Parameter Query | Excel Discussion (Misc queries) | |||
Excel 2007 / MS Query - editing existing query to another sheet | Excel Discussion (Misc queries) | |||
Web query: Want to pause macro while Web query completes refreshin | Excel Programming | |||
Edit Query from Excel will not open query in MSQuery | Excel Programming |