I'm trying to add a exit button on my spread sheet that closes excel if no other workbooks are open or if others are open, it closes just my spreadsheet.
Sub Byebye()
'add code to save your workbook here, if you wish
' note that the count of open workbooks will
'include any hidden workbooks, such as Personal.xls
If Application.Workbooks.Count = 1 Then
Application.Quit
Else
ActiveWorkbook.Close
End If
End Sub