Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change properties of a multipage
I am working with Excel 2007
I have a form (frmMenu) with a multipage (Multipage1)containing 4 pages (pg1, pg2, pg3, pg4). I would like to change the visible property of page 4 (pg4) from true to false using VBA code. I don't seem to be able to find the code needed to select pg4 to change the properties of this page. Can you help? *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change properties of a multipage
Click the form to toggle visibility of page-4
Private Sub UserForm_Click() With Me.MultiPage1.Pages(3) .Visible = Not .Visible End With End Sub Multipage pages are indexed from zero, so MultiPage1.Pages(3) refers to the 4th page Regards, Peter T "Gerhard Ganser" wrote in message ... I am working with Excel 2007 I have a form (frmMenu) with a multipage (Multipage1)containing 4 pages (pg1, pg2, pg3, pg4). I would like to change the visible property of page 4 (pg4) from true to false using VBA code. I don't seem to be able to find the code needed to select pg4 to change the properties of this page. Can you help? *** Sent via Developersdex http://www.developersdex.com *** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change properties of a multipage
I'm not sure where you would want this code. Maybe you could insert in under
an Event or insert it into some of you current code but this line will help. MultiPage1.Pages(3).Visible = True "MultiPage1" is the name of multipage. So if you have a different name you will have to change it. The Page Index in a MultiPage starts at 0 by default. For example, Pages(0) = pg1, Pages(1) = pg2, etc. Hope this helps! -- Cheers, Ryan "Gerhard Ganser" wrote: I am working with Excel 2007 I have a form (frmMenu) with a multipage (Multipage1)containing 4 pages (pg1, pg2, pg3, pg4). I would like to change the visible property of page 4 (pg4) from true to false using VBA code. I don't seem to be able to find the code needed to select pg4 to change the properties of this page. Can you help? *** Sent via Developersdex http://www.developersdex.com *** |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change properties of a multipage
And you can use the name of the page if you want:
Me.MultiPage1.Pages("pg4").Visible = False Gerhard Ganser wrote: I am working with Excel 2007 I have a form (frmMenu) with a multipage (Multipage1)containing 4 pages (pg1, pg2, pg3, pg4). I would like to change the visible property of page 4 (pg4) from true to false using VBA code. I don't seem to be able to find the code needed to select pg4 to change the properties of this page. Can you help? *** Sent via Developersdex http://www.developersdex.com *** -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change properties of a multipage
Thanks Peter The code you sent works fine when I click the user form. I like the toggle idea. I would however like to activate the code from a command button that is on one of the multipages. I have used the code frmMenu.Multipage1.Pages(3).visible =false or by modifying your code as follows With frmMenu.Multipage1.Pages(3) .visible = not.visible For some reason it does not seem to identify the page to change the visible property. Any thoughts Thanks again for your help so far! *** Sent via Developersdex http://www.developersdex.com *** |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change properties of a multipage
I ran similarly from a button on a multipage and it worked absolutely fine.
Even if the button is on the page-4 it can at least make itself not visible. Try this, in your commandbutton's click event Private Sub CommandButton1_Click() With Me.MultiPage1.Pages(3) .Visible = Not .Visible Me.Caption = UserForm1.MultiPage1.Pages(3).Visible Me.Caption = .Name & " visible=" & .Visible End With End Sub Regards, Peter T "Oscar" wrote in message ... Thanks Peter The code you sent works fine when I click the user form. I like the toggle idea. I would however like to activate the code from a command button that is on one of the multipages. I have used the code frmMenu.Multipage1.Pages(3).visible =false or by modifying your code as follows With frmMenu.Multipage1.Pages(3) visible = not.visible For some reason it does not seem to identify the page to change the visible property. Any thoughts Thanks again for your help so far! *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MultiPage exit/change event | Excel Programming | |||
change label on multipage | Excel Programming | |||
MultiPage change CRASH! | Excel Programming | |||
Deactivating Multipage Change Event | Excel Programming | |||
Deactivating Multipage Change Event | Excel Programming |