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: 49
Default Query Changes

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
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
Import New Database Query (Union Query) in Spreadsheet klock Excel Discussion (Misc queries) 2 September 24th 09 01:30 AM
Convert hard coded query criteria to Parameter Query Melanie[_2_] Excel Discussion (Misc queries) 0 July 15th 08 09:59 PM
Excel 2007 / MS Query - editing existing query to another sheet Hotpepperz Excel Discussion (Misc queries) 0 June 13th 08 06:53 PM
Web query: Want to pause macro while Web query completes refreshin Ellis Excel Programming 4 August 6th 07 04:04 AM
Edit Query from Excel will not open query in MSQuery Michelle Excel Programming 0 February 21st 05 03:59 PM


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