Hello and thank you for any attention my post may receive.
I have a userform (frmCalendar) which appears when I click a specific cell (C4) on a worksheet (Scorecard).
The problem I have is that when I close the worksheet through a 'Save' command button and selecting 'Yes' in the message box, the form reappears and I have to close it manually. How do I stop it from appearing other than only when I select the target cell?
Message box code
This is so frustrating.
I have a userform (frmCalendar) which appears when I click a specific cell (C4) on a worksheet (Scorecard).
The problem I have is that when I close the worksheet through a 'Save' command button and selecting 'Yes' in the message box, the form reappears and I have to close it manually. How do I stop it from appearing other than only when I select the target cell?
Message box code
Code:
If ActiveSheet.Range("H9") < 9 Then
MsgBox "Hang on a bit " & myName & ". You have not completed all required fields." & vbNewLine & vbNewLine & _
"Select OK and have another go.", , "Hey wait a sec....."
Else
Msg = "Thank you for completing the Scorecard " & myName & "." & vbNewLine & vbNewLine & _
"Select 'Yes' to save the results, after doing so this audit will be unavailable for editing." & vbNewLine & vbNewLine & _
"'No' will return to the sheet."
Ans = MsgBox(Msg, vbYesNo + vbQuestion, "Hang on and think about what you are planning to do........") ', vbExclamation)
End If
Select Case Ans
Case vbYes
Application.DisplayAlerts = False
Set ws1 = ActiveSheet
Set ws2 = Sheets("Audit_Log")
Set ws3 = Sheets("INSTRUCTIONS")
Set ws4 = Sheets("Constants")
Set ws5 = Sheets("Action_Log")
pdfname = "5S_Audit_" & Range("B8").value & "_" & Range("D4").value & " - " & Format(Range("B4"), "yyyymmdd")
pdffilename = "S:\12.MGMT\BEx\5S\Audits and Schedules\Audit Scorecards\" & pdfname
This is so frustrating.