Sniperbooya
Registered User.
- Local time
- Today, 19:35
- Joined
- Jan 30, 2015
- Messages
- 16
Hi guys,
Last week a friend of mine asked me to write a little code to change the font color of a certain range when the conditions of that certain cell are met.
So i wrote him the following code and everything was working fine:
But as of today the code is not working anymore. Well at least the
bit is not working anymore.
When I put the same code 'under' a button it works perfectly.
I thought maybe i disabled the events but even after manually enabling the events it doesnt work.
Any ideas?
Thanks !
Last week a friend of mine asked me to write a little code to change the font color of a certain range when the conditions of that certain cell are met.
So i wrote him the following code and everything was working fine:
Code:
Private Sub Workbook_SheetChange(ByVal Target As Range)
Dim c As Range
For Each c In Range("I1:I485").Cells
c.Select
If c.Value = "Binnendijks" Then
ActiveSheet.Unprotect Password:="01FGSlab1962"
With Selection.Font
c.Font.Color = RGB(76, 153, 0)
End With
ActiveSheet.Protect Password:="01FGSlab1962"
End If
Next
Dim c2 As Range
For Each c2 In Range("I1:I485").Cells
c2.Select
If c2.Value = "Buitendijks" Then
ActiveSheet.Unprotect Password:="01FGSlab1962"
With Selection.Font
c2.Font.Color = RGB(255, 128, 0)
End With
ActiveSheet.Protect Password:="01FGSlab1962"
End If
Next
Range("A13").Select
End Sub
But as of today the code is not working anymore. Well at least the
Code:
Workbook_SheetChange(ByVal Target As Range)
bit is not working anymore.
When I put the same code 'under' a button it works perfectly.
I thought maybe i disabled the events but even after manually enabling the events it doesnt work.
Any ideas?
Thanks !