Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
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 Control Pages - Changing Index Value in Code misseill Excel Programming 1 July 13th 05 04:55 PM
Changing control properties/code through code Ajit Excel Programming 3 October 18th 04 09:03 PM
Set Focus Problem for textbox control on multipage control ExcelDeveloperSPR Excel Programming 1 July 16th 04 08:54 PM
how to make a multipage with many pages all of which can be seen easily. youngman Excel Programming 3 October 8th 03 01:53 AM
Displaying different pages in MultiPage Joepy Excel Programming 0 August 11th 03 01:03 PM


All times are GMT +1. The time now is 12:19 AM.

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"