Jeff Beagley
Jeff Beagley

Reputation: 1025

Userform MultiPage Navigation

I have a Userform I built in Excel that has roughly ten tabs utilizing the MultiPage setup. Problem is I am running out of space for additional tabs and would really like to replace the tabs with a friendlier Navigation Menu or Toolbar. I've looked into the Microsoft ToolBar Control, which is close to what I'm looking for but I can't change the height and the dropdown has to have the arrow clicked and nto the text, which is not that intuitive in my opinion.

So my question is, are any of you familiar with a better multipage navigation setup, perhaps using a form of ActiveX?

Upvotes: 0

Views: 1130

Answers (2)

Jeff Beagley
Jeff Beagley

Reputation: 1025

What I ended up doing was making a Listbox with all my different pages that is apart of my Multipage then placed this listbox on the left hand side of my Userform then used this code

Populate the listbox

    i = 0
    With Main_Window.form_navigation_list
            .AddItem "Domestic"
                .List(i, 0) = "Page 1"
                .List(i, 1) = 0
        i = i + 1
            .AddItem
                .List(i, 0) = "Page 2"
                .List(i, 1) = 1
        i = i + 1
End With

Then I have this for the on click

Private Sub form_navigation_list_Click()
    Dim i As Integer
    Dim SelectedRow As Integer

        For SelectedRow = 0 To Main_Window.form_navigation_list.ListCount - 1
            If Main_Window.form_navigation_list.Selected(SelectedRow) Then
                nav_page = Main_Window.form_navigation_list.List(SelectedRow, 1)
                With Main_Window
                    .MultiPage1.Value = nav_page
                    .Show
                End With
            End If
        Next

End Sub

I started off using a flexgrid but kept getting a memory leak issue and program would crash, so I swapped to the listbox and it's working fine now. Now I can customize this listbox to look a bit more like the navigation I want.

Upvotes: 0

JDB_Dragon
JDB_Dragon

Reputation: 162

I would reccommend seperating your User Form into seperate forms or Child forms based on category. You can have one form launch another one if they are both Modeless, and both can be on screen at the same time. This way, you can work with both consecutively.

To launch a form as modeless, when you do Form1.Show change it to Form1.Show vbModeless

Upvotes: 1

Related Questions