Visable Property

Kavy

Well-known Member
Joined
Jun 25, 2007
Messages
607
Good Morning All, if your in North/South America that is
Anyway, using Excel, vb user forms...

I have a lot of stuff on form, and when I hit a back button I would like 95% of it to be not visiable to the user. Is there a way besides setting each visable property to false, can i say all false except for these 4 items or something?

Thanks!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
Something like this ... ?
Code:
Private Sub CommandButton1_Click()
    ' Hide all controls
    For Each ctl In Me.Controls
        ctl.Visible = False
    Next
    '- make some visible
    CommandButton1.Visible = True
End Sub
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,357
Office Version
  1. 365
Platform
  1. Windows
Kavy

How will you be determining which controls are visible?

You mention a back button, couldn't you reload the form like I showed you in your other thread.

If that's not suitable you'll need an approach like Brian has suggested, but you'll also need to think about my first question.
 

Kavy

Well-known Member
Joined
Jun 25, 2007
Messages
607
Hey sorry about the lateness of this reply, i am unloading the form like you said Norie, thanks as always!.

Brian, thanks a lot, you gave me an idea, now i can compelty reload the form or i can just go back one step into the form !
 

Forum statistics

Threads
1,181,054
Messages
5,927,855
Members
436,573
Latest member
CMR237

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top