Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multipage Control Pages - Changing Index Value in Code
I have a multipage control, mpManyTabs, and an array, strTabNames. I
want the pages in mpManyTabs to be indexed in the order determined by the array's entries. All of the pages have captions that correspond to an entry in the array. I am able to cycle through the pages, look at the caption and see if it matches my array entry. If it does, I'd like to change the matching page's index to be the array's index. Can I do that in code? The line mpManyTabs.Pages(lngPages).index = lngCount-1 below is giving me trouble. Private Sub ShuffleTabs(strTabNames() As String) Dim lngCount As Long Dim strTabName As String Dim lngPages As Long For lngCount = 1 To UBound(strTabNames) 'cycle through mpManyTabs.Pages, until you find the caption 'that is the same as strTabNames(lngcount) For lngPages = 0 To mpManyTabs.Pages.Count - 1 If mpManyTabs.Pages(lngPages).Caption = strTabNames(lngCount) Then 'Index starts at zero. subtract one! mpManyTabs.Pages(lngPages).index = lngCount-1 Exit For End If Next lngPages Next lngCount End Sub I appreciate your help in advance, and I hope I was clear enough! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multipage Control Pages - Changing Index Value in Code | Excel Programming | |||
Changing control properties/code through code | Excel Programming | |||
Set Focus Problem for textbox control on multipage control | Excel Programming | |||
how to make a multipage with many pages all of which can be seen easily. | Excel Programming | |||
Displaying different pages in MultiPage | Excel Programming |