I have a protected form that organizes user input from open cells onto another excel sheet and emails it to specific people. This form has worked flawlessly for years, but suddenly yesterday it's throwing a Run-time error '1004': Application-defined or object-defined error. When I enter anything into the form, the error appears immediately, and the debugger highlights the following line of code.
Range("AL6").Font.Color = vbWhite
On the form where a user adds their information, the cells that are open to users range from AF6-AK6 and auto-populate tomorrows date. AL6 is outside this and protected. There is nothing in cell 'AL6' and nor should there be. This is the code block in which the error dwells.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Time > 15 / 24 And Range("AF6") = Application.WorksheetFunction.WorkDay(Date, 0) Then
Range("AL6").Font.Color = vbRed
Else
Range("AL6").Font.Color = vbWhite
End If
End Sub
The form is also saved regularly, so I don't think it's a matter of duplicating itself and becoming corrupted. I also cannot rule that possibility out. Any thoughts?