Explain any options for the statement: FormatConditions(1).StopIfTrue = False
The code works as intended. I just don't understand the values.
Just wish to understand why it is always a (1) and = False in the examples.
Also, want to know if there are any additional opportunities to have other options.
In Microsoft Access linked to SQL Server and Oracle, I use vba to create highly customized Excel reports (remote automation).
The objXL is just a reference to the Excel Application. The recordset object provides the number of columns and row count.
Also posted at the Access site: Excel - CopyFromRecordset - Set Rules for values - Access World Forums
The code works as intended. I just don't understand the values.
Just wish to understand why it is always a (1) and = False in the examples.
Also, want to know if there are any additional opportunities to have other options.
In Microsoft Access linked to SQL Server and Oracle, I use vba to create highly customized Excel reports (remote automation).
The objXL is just a reference to the Excel Application. The recordset object provides the number of columns and row count.
Code:
' intRowPos is 5 - the data starts at row 5 to allow for a title bar
objxl.DisplayAlerts = False ' Turn off Display Alerts
objxl.Worksheets(intWorksheetNum).Cells(intRowPos, 1).CopyFromRecordset rsDataRE_Seg1Rule intMaxheaderColCount = rsDataRE_Seg1Rule.Fields.Count - 1 ' use recordset object to capture intMaxRecordCount. IntRowPos is a rownumber where the data begins.
objxl.Range(Cells(intRowPos, 1), Cells(intMaxRecordCount + (intRowPos), intMaxheaderColCount + 1)).Select ' SPECIAL SECTION turns True Green and False to RED - using SELECTION
objxl.Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=FALSE"
objxl.Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With objxl.Selection.FormatConditions(1).Font
.Color = -16383844
End With
With objxl.Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
End With
objxl.Selection.FormatConditions(1).StopIfTrue = False
objxl.Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=TRUE"
objxl.Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With objxl.Selection.FormatConditions(1).Font
.Color = -16752384
End With
With objxl.Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13561798
End With
objxl.Selection.FormatConditions(1).StopIfTrue = False