I'm having trouble with the sub I've created called 'NotCompleteCount.' When I test it, a pop-up appears saying that 'Compile Error: Expected function or variable' referring to the 'If NotCompleteCount > 0 Then' line. What I'm trying to do is to get the message to be different if some of the milestones/deliverables in my spreadsheet are not complete (i.e. the count of items with a green, amber, red, or not started status is greater than one).
Thanks very much in advance for any help and the code relevant code can be found below:
Set o5 = Application.ActiveSheet.OptionButton5
If o5.Value = True Then
If NotCompleteCount > 0 Then
response = MsgBox("You have selected COMPLETE as the overall status of this item. HOWEVER, not all deliverables/milestones are set to COMPLETE. Do you still wish to send?", _
vbYesNo, "Confirm")
If (response = VbMsgBoxResult.vbYes) Then
SendReport
End If
Else: response = MsgBox("You have selected COMPLETE as the overall status of this item. Please confirm that this is correct, all details are complete and you are ready to send" _
, vbYesNo, "Confirm")
If (response = VbMsgBoxResult.vbYes) Then
SendReport
End If
End If
End If
Sub NotCompleteCount()
Count = [CountIf(E30:E42,"green";"red";"amber";"not started")]
End Sub
Thanks very much in advance for any help and the code relevant code can be found below:
Set o5 = Application.ActiveSheet.OptionButton5
If o5.Value = True Then
If NotCompleteCount > 0 Then
response = MsgBox("You have selected COMPLETE as the overall status of this item. HOWEVER, not all deliverables/milestones are set to COMPLETE. Do you still wish to send?", _
vbYesNo, "Confirm")
If (response = VbMsgBoxResult.vbYes) Then
SendReport
End If
Else: response = MsgBox("You have selected COMPLETE as the overall status of this item. Please confirm that this is correct, all details are complete and you are ready to send" _
, vbYesNo, "Confirm")
If (response = VbMsgBoxResult.vbYes) Then
SendReport
End If
End If
End If
Sub NotCompleteCount()
Count = [CountIf(E30:E42,"green";"red";"amber";"not started")]
End Sub