Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button
Go Back  Xtreme Visual Basic Talk > > > > Show and Hide Userform and worksheet using Toggle button and Command button


Reply
 
Thread Tools Display Modes
  #1  
Old 02-25-2017, 01:30 AM
DawidV DawidV is offline
Newcomer
 
Join Date: Feb 2017
Posts: 2
Default Show and Hide Userform and worksheet using Toggle button and Command button


Hi
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:
HTML Code:
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
Thanx

Last edited by DawidV; 02-25-2017 at 01:33 AM. Reason: Heading incorrent
Reply With Quote
  #2  
Old 02-26-2017, 09:16 AM
Goggy's Avatar
Goggy Goggy is offline
Contributor
 
Join Date: Sep 2005
Location: Enschede,The Netherlands
Posts: 670
Default Maybe you could use the userform events.

Something like so?

Code:
Private Sub UserForm_Activate()
    Application.Visible = False
End Sub

Private Sub UserForm_Terminate()
    Application.Visible = True
End Sub
__________________
As finishing touch, god created the Dutch!

utterly useless, but always trying to help
Reply With Quote
  #3  
Old 02-26-2017, 09:35 AM
DawidV DawidV is offline
Newcomer
 
Join Date: Feb 2017
Posts: 2
Default

Thanx a mill. will try this
Reply With Quote
Reply

Tags
worksheet, userform, button, true, false, excel, click, spreadsheet, private, visible, tgldashshowsheet.value, &h80ff, hide, application.visible, dashboard, hidden, inactive, applicationsdata.hide, cmddashcloseform_click, option, window, set, properties, selected, vba


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button
 
Show and Hide Userform and worksheet using Toggle button and Command button
Show and Hide Userform and worksheet using Toggle button and Command button
 
-->