Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I understand the use of this command: Menu.MultiPage1.Pages(8).Enabled = True BUT what I would like to do is not use a page number and use the Pages name instead, is this possible? Something like: Menu.MultiPage1.Pages("Main Menu").Enabled = True -- Trefor |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't think that you can do it that easily, what you can do is run
through all pages and look for the name: '---------------------------------- Function return_pageNum(PageName As String) As Byte return_pageNum = 0 For i = 0 To Me.MultiPage1.Pages.Count Debug.Print Me.MultiPage1.Pages(i).Name If LCase(Me.MultiPage1.Pages(i).Name) = LCase(PageName) Then return_pageNum = i Exit For End If Next i End Function '---------------------------------- if there is an easier possibility, i'm eager to learn. cheers carlo On Dec 21, 10:49*am, Trefor wrote: I understand the use of this command: Menu.MultiPage1.Pages(8).Enabled = True BUT what I would like to do is not use a page number and use the Pages name instead, is this possible? Something like: Menu.MultiPage1.Pages("Main Menu").Enabled = True -- Trefor |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Wait a second...i just tried it and this works for me:
me.multipage1.pages("mypage").enabled = true what excel are you using? Carlo On Dec 21, 11:04*am, carlo wrote: I don't think that you can do it that easily, what you can do is run through all pages and look for the name: '---------------------------------- Function return_pageNum(PageName As String) As Byte return_pageNum = 0 For i = 0 To Me.MultiPage1.Pages.Count * * Debug.Print Me.MultiPage1.Pages(i).Name * * If LCase(Me.MultiPage1.Pages(i).Name) = LCase(PageName) Then * * * * return_pageNum = i * * * * Exit For * * End If Next i End Function '---------------------------------- if there is an easier possibility, i'm eager to learn. cheers carlo On Dec 21, 10:49*am, Trefor wrote: I understand the use of this command: Menu.MultiPage1.Pages(8).Enabled = True BUT what I would like to do is not use a page number and use the Pages name instead, is this possible? Something like: Menu.MultiPage1.Pages("Main Menu").Enabled = True -- Trefor- Hide quoted text - - Show quoted text - |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Did you rename the page to that Name? Notice the OP has a space in his
"name", which must mean he is trying to reference the page through its Caption, not its Name. Rick "carlo" wrote in message ... Wait a second...i just tried it and this works for me: me.multipage1.pages("mypage").enabled = true what excel are you using? Carlo On Dec 21, 11:04 am, carlo wrote: I don't think that you can do it that easily, what you can do is run through all pages and look for the name: '---------------------------------- Function return_pageNum(PageName As String) As Byte return_pageNum = 0 For i = 0 To Me.MultiPage1.Pages.Count Debug.Print Me.MultiPage1.Pages(i).Name If LCase(Me.MultiPage1.Pages(i).Name) = LCase(PageName) Then return_pageNum = i Exit For End If Next i End Function '---------------------------------- if there is an easier possibility, i'm eager to learn. cheers carlo On Dec 21, 10:49 am, Trefor wrote: I understand the use of this command: Menu.MultiPage1.Pages(8).Enabled = True BUT what I would like to do is not use a page number and use the Pages name instead, is this possible? Something like: Menu.MultiPage1.Pages("Main Menu").Enabled = True -- Trefor- Hide quoted text - - Show quoted text - |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Carlo,
Thanks for your help, between you and Rick its fixed thanks. -- Trefor "carlo" wrote: Wait a second...i just tried it and this works for me: me.multipage1.pages("mypage").enabled = true what excel are you using? Carlo On Dec 21, 11:04 am, carlo wrote: I don't think that you can do it that easily, what you can do is run through all pages and look for the name: '---------------------------------- Function return_pageNum(PageName As String) As Byte return_pageNum = 0 For i = 0 To Me.MultiPage1.Pages.Count Debug.Print Me.MultiPage1.Pages(i).Name If LCase(Me.MultiPage1.Pages(i).Name) = LCase(PageName) Then return_pageNum = i Exit For End If Next i End Function '---------------------------------- if there is an easier possibility, i'm eager to learn. cheers carlo On Dec 21, 10:49 am, Trefor wrote: I understand the use of this command: Menu.MultiPage1.Pages(8).Enabled = True BUT what I would like to do is not use a page number and use the Pages name instead, is this possible? Something like: Menu.MultiPage1.Pages("Main Menu").Enabled = True -- Trefor- Hide quoted text - - Show quoted text - |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The problem is you are trying to use the Caption property to identify the
Page within the collection, not the Page's name. When you click on the tab for the "Main Menu", look at the Properties window... see the Name, it is Page8 (or whatever number your page is). Change the name to MainMenu (notice, because it is a name, you can't have a separating space in it); now, change "Main Menu" to "MainMenu" in your code statement and it should work the way you are expecting. Rick I understand the use of this command: Menu.MultiPage1.Pages(8).Enabled = True BUT what I would like to do is not use a page number and use the Pages name instead, is this possible? Something like: Menu.MultiPage1.Pages("Main Menu").Enabled = True -- Trefor |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rick,
Spot on thanks. Should have thought about that myself. -- Trefor "Rick Rothstein (MVP - VB)" wrote: The problem is you are trying to use the Caption property to identify the Page within the collection, not the Page's name. When you click on the tab for the "Main Menu", look at the Properties window... see the Name, it is Page8 (or whatever number your page is). Change the name to MainMenu (notice, because it is a name, you can't have a separating space in it); now, change "Main Menu" to "MainMenu" in your code statement and it should work the way you are expecting. Rick I understand the use of this command: Menu.MultiPage1.Pages(8).Enabled = True BUT what I would like to do is not use a page number and use the Pages name instead, is this possible? Something like: Menu.MultiPage1.Pages("Main Menu").Enabled = True -- Trefor |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Format page number in excel footer to start at a specific page # | Excel Discussion (Misc queries) | |||
Remove big gray page number on Page Break Preview??? | Excel Discussion (Misc queries) | |||
change and/or remove page number watermark in page break preview | Excel Discussion (Misc queries) | |||
How do I print a one page spreadsheet multiple time, each with its own page number? | Excel Discussion (Misc queries) | |||
Hide a page in a multi page userform | Excel Programming |