View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
titus titus is offline
external usenet poster
 
Posts: 8
Default Using Font Colour


Kevin wrote:
Hi,

If i have a list in column A. Some have black fonts and others have blue
fonts. How can I have the cell next to the black font in column B to say
'true' and the cell next to the blue font to say 'false'

Cheers

Kevin


Put your data in column A and select it and put this code in the vba
editor under module

Sub trueorfalse()
Dim cell As Range

For Each cell In Selection
If cell.Font.ColorIndex = 5 Then
Cells(cell, 2) = "False"
Else
Cells(cell, 2) = "True"
End If
Next cell

End Sub

Cheers
titus