I am having no luck with this. I want to prevent a user from saving the workbook if some cells in Range("K8:S51") are still red because the conditions have not been met to turn change them. Here is what I have thus far and no matter what I do it gives me an error. I am not sure if I use Index number or RGB?
Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
With Sheets("WorkSheet-1").Range("K8:S51")
.FormatConditions
If .Interior.ColorIndex = 36 Then
Cancel = True
End If
End With
MsgBox "Worksheet needs to be completed properly"
End Sub
Bookmarks