I have VB code running to allow multiple items to be selected from a drop down. The VB code also unlocks and locks the sheet before and after. However, users have the need to proof read the text that others submit and I require that they make deletions in red text and additions in blue text. I am unable to figure out how to allow 5 cells to be unlocked for font color only, nothing else. Is there a way to only allow font color to be changed in these 5 cells in my VB code as the last step? Or possibly I am thinking about this in the wrong way and it needs to be done another way. Corrections or suggestions would be welcomed as well as I am stuck. My VB code is below, and the cells that I require users to be able to change font color are: D55, D56, D57, D59, D62. Thank you very much in advance.
Private Sub Worksheet_Change(ByVal Target As Range)
Sheet1.Unprotect Password:="hi"
Dim Oldvalue As String
Dim Newvalue As String
Application.EnableEvents = True
On Error GoTo Exitsub
If Target.Address = "$D$16" Or Target.Address = "$D$24" Or Target.Address = "$D$31" Or Target.Address = "$D$35" Or Target.Address = "$D$58" Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
If InStr(1, Oldvalue, Newvalue) = 0 Then
Target.Value = Oldvalue & ", " & Newvalue
Else:
Target.Value = Oldvalue
End If
End If
End If
End If
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True
Sheet1.Protect Password:="hi"
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Sheet1.Unprotect Password:="hi"
Dim Oldvalue As String
Dim Newvalue As String
Application.EnableEvents = True
On Error GoTo Exitsub
If Target.Address = "$D$16" Or Target.Address = "$D$24" Or Target.Address = "$D$31" Or Target.Address = "$D$35" Or Target.Address = "$D$58" Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
If InStr(1, Oldvalue, Newvalue) = 0 Then
Target.Value = Oldvalue & ", " & Newvalue
Else:
Target.Value = Oldvalue
End If
End If
End If
End If
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True
Sheet1.Protect Password:="hi"
End Sub