PDA

View Full Version : Solved: colorindex = xlnone ?



Charlize
03-04-2007, 02:59 PM
Does someone have the same experience when using this lineCells.Interior.ColorIndex = xlNone the cell colors turquoise instead of removing the color and when using this Cells.Interior.ColorIndex = xlColorIndexNonethe cell color is indead removed.

Charlize

Simon Lloyd
03-04-2007, 04:42 PM
How about using something like:
Sub cfind()
For Each cell In Selection
If cell.Interior.ColorIndex <> xlNone Then
MsgBox "Found Colour at " & cell.Address & "This Colour Index " & cell.Interior.ColorIndex
End If
Next
End Sub
this will search your selected range and provide you with the cell address and the colour index!J ust in case there some underlying format or if it was an import from a website etc.
Regards,
SImon

mdmackillop
03-04-2007, 04:57 PM
Check for conditional formatting.

Simon Lloyd
03-04-2007, 05:40 PM
Sorry Malcom i should have thought of that!


Sub cfind()

For Each cell In Selection
If cell.Interior.ColorIndex <> xlNone Then
MsgBox "Found Colour at " & cell.Address & "This Colour Index " & cell.Interior.ColorIndex
End If
Next
Selection.FormatConditions.Delete
End Sub
if you dont want to use VBA to delete format conditions you can always press Ctrl+A twice! and then go to conditional formatting and delete.

Regards,
SImon