Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MultiPage exit/change event Patrick Simonds Excel Programming 2 August 29th 06 04:06 AM
change label on multipage [email protected] Excel Programming 3 August 27th 06 05:51 PM
MultiPage change CRASH! Drummer361 Excel Programming 0 August 21st 06 04:26 PM
Deactivating Multipage Change Event [email protected] Excel Programming 0 September 9th 04 03:13 AM
Deactivating Multipage Change Event [email protected] Excel Programming 2 September 9th 04 02:49 AM


All times are GMT +1. The time now is 08:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"