Replace the existing code with the following
Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(0, 0) <> "K6" Then Exit Sub
Const PassWD As String = "pass"
Me.Unprotect PassWD
If InStr(1, Target.Value, "post", 1) Then
Range("l10").Resize(Me.UsedRange.Rows.Count).Font.Color = Target.Interior.Color
Else
Range("l10").Resize(Me.UsedRange.Rows.Count).Font.Color = Target.Font.Color
End If
Me.Cells.Locked = False
Me.Range("l10").Resize(Me.UsedRange.Rows.Count, 3).Locked = True ',3 because the columns are merged
Me.Protect PassWD
End Sub
Bookmarks