View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
punking315 punking315 is offline
external usenet poster
 
Posts: 6
Default changing font color in named range using vba

I recieve a runtime error..." method 'color' of object 'font' failed "


this is the code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim black As Long
Dim white As Long
black = vbBlack
white = vbWhite

If Cells(5, 2).Text = "gable" Then
Range("saltboxroofing").Font.Color = white
Else
If Cells(5, 2).Text = "saltbox" Then
Range("saltboxroofing").Font.Color = black
Else
End If
End If
End Sub

any help is appreciated