I am currently having problems to Show and Hide UserForm and worksheet properly. When I open the workbook everything works fine. The Userorm opens and the Worksheet is hidden as I want it. When I click the Show Worksheet the worksheet appears. However when I click the Close UserForm the UserForm and Worksheet disappears completely!
I am very new to VBA.
Here is the code I am using:
Private Sub tglDashShowSheet_Click() 'TOGGLE BUTTON ON DASHBOARD - TO SHOW WORKSHEET - WHEN EXCEL OPENS ONLY THE USERFORM WILL 'VISIBLE - EXCEL SPREADSHEET IS HIDDEN If tglDashShowSheet.Value = False Then 'VISIBLE IS SET TO TRUE IN PROPERTIES WINDOW Application.Visible = False tglDashShowSheet.BackColor = &H80FF& End If 'IF SPREADSHEET OPTION IS SELECTED THE BUTTON BECOMES INACTIVE If tglDashShowSheet.Value = True Then Application.Visible = True tglDashShowSheet.BackColor = &H80FF& End If End Sub Private Sub cmdDashCloseForm_Click() 'HIDE USERFORM - DASHBOARD BUTTON ApplicationsData.Hide End Sub