View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default A Boolean expression

Oops.., forgot some dots...


Sub CellColLetter() '//Ctrl+q
Dim n&
With Selection
For n = 1 To Selection.Cells.Count
.Cells(n).Interior.ColorIndex = IIf(.Cells(n).Interior.ColorIndex
< 6, 6, xlNone)
.Cells(n) = IIf(.Cells(n).Interior.ColorIndex = 6, "A", "")
Next 'n
End With
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion