M
moon
How to using Range selection to check cell have formated using "color
index=35".
Sub Macro1()
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End Sub
Step1 . Select a area by rows.
Step2. Run sub ErCheckColor
How to write below code to check cell have formated with color index =35, if
not selected row set "0" otherwise set "1".
Sub ErCheckColor()
areaCount = Selection.Areas.Count
If areaCount <= 1 Then
MsgBox "The selection contains " & _
Selection.Rows.Count & " rows."
Else
I = 1
For Each a In Selection.Areas
MsgBox "Area " & I & " of the selection contains " & _
a.Rows.Count & " rows."
I = I + 1
Next a
End If
End Sub
index=35".
Sub Macro1()
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End Sub
Step1 . Select a area by rows.
Step2. Run sub ErCheckColor
How to write below code to check cell have formated with color index =35, if
not selected row set "0" otherwise set "1".
Sub ErCheckColor()
areaCount = Selection.Areas.Count
If areaCount <= 1 Then
MsgBox "The selection contains " & _
Selection.Rows.Count & " rows."
Else
I = 1
For Each a In Selection.Areas
MsgBox "Area " & I & " of the selection contains " & _
a.Rows.Count & " rows."
I = I + 1
Next a
End If
End Sub