I have an exit button on a userform with the following code
Private Sub cmdExit_Click()
Application.DisplayAlerts = False
ThisWorkbook.Close
End Sub
I would like it to check to see if any other workbooks are open and if there is then just close the current one only without saving, but if there isn't any other workbooks open I'd like it to close excel.
Private Sub cmdExit_Click()
Application.DisplayAlerts = False
ThisWorkbook.Close
End Sub
I would like it to check to see if any other workbooks are open and if there is then just close the current one only without saving, but if there isn't any other workbooks open I'd like it to close excel.