Change font to red and bold

D

Derek

Excel 2000
Help please, I would like to change the font to red and
make it bold when the value is greater than 0.5. The
color changes ok but when I add the bold=true statement it
fails. Please correct me..

Private Sub workbook_sheetchange(ByVal sh As Object, ByVal
Target As Range)
If Not Intersect(Target, Range("f5:f33")) Is Nothing Then
If Target.Value >= 0.5 Then
Target.Font.ColorIndex = 3: Target.Font.Bold = True
End If
End If
End Sub

TIA, derek
 
P

papou

Hello Derek
Have a line break between Target.Font.ColorIndex and Target.Font.Bold = True
ie:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("f5:f33")) Is Nothing Then
If Target.Value >= 0.5 Then
Target.Font.ColorIndex = 3
Target.Font.Bold = True
End If
End If
End Sub

HTH
Regards
Pascal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top