First, the workbook_beforeclose event isn't something you call--it's an event
that excel is always listening for (unless you tell it not to listen!).
Put the code in the ThisWorkbook module, not a General module.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
And don't change the name of the procedure. Excel knows what names to use. If
you change it, excel won't find it.
I don't like to branch using goto's. I think that this works the way you want.
Compiled, but not tested:
Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim OkToClose As Boolean
Dim myRngToCheck As Range
Dim myCell As Range
Dim Resp As Long
OkToClose = True
With Worksheets("Test")
Set myRngToCheck = .Range("A1
60")
End With
For Each myCell In myRngToCheck.Cells
If myCell.Interior.ColorIndex = 35 _
Or myCell.Interior.ColorIndex = 3 Then
OkToClose = False
'stop looking for more problems
Exit For
End If
Next myCell
If OkToClose Then
'don't ask the question, and just close
Else
Resp = MsgBox("Do you really want to close the workbook?", vbYesNo)
If Resp = vbNo Then
Cancel = True
End If
End If
End Sub