PDA

View Full Version : Solved: Font.Name Debug



LarryLaser
10-11-2006, 08:39 AM
I got some help from Jake on this (http://vbaexpress.com/forum/showthread.php?t=9768) solution and it worked the first time I tried it. but now I get a debug error and I cant figure out the problem withit.

Option Explicit

Private Sub Worksheet_Activate()
Range("C" & Rows.Count).End(xlUp).Offset(1, 0).Select
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)

If Intersect(Target, Range("C5:AZ31")) Is Nothing Then
Exit Sub
End If

Application.EnableEvents = False

If UCase(Target.Text) = "Y" Then
Target.Value = "?"
(error) Target.Font.Name = "Wingdings"
Else
Target.ClearContents
End If

Application.EnableEvents = True

End Sub

mdmackillop
10-11-2006, 08:46 AM
Your worksheet is protected.

LarryLaser
10-11-2006, 09:06 AM
Got it MD
Thankyou Very much. :thumb:

Private Sub Worksheet_Change(ByVal Target As Range)

ActiveSheet.Unprotect

If Intersect(Target, Range("C5:AZ31")) Is Nothing Then
Exit Sub
End If

Application.EnableEvents = False

If UCase(Target.Text) = "Y" Then
Target.Value = "?"
Target.Font.Name = "Wingdings"
Else
Target.ClearContents
End If

Application.EnableEvents = True

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

End Sub