0

I have a userform with a multipage box on it. There are a few tabs on this multipage. I inserted a ListBox on the first page but it seems to appear no matter what tab is selected. I only want it to appear on the first page. Is there a property to change this?

Here is my code for opening the new multipage userform (TabData):

Unload MainSelectionForm
TabData.Show

As you can see, on the first page there is a ListBox (black border)

Clicking on the second tab, there is still a listbox

Community
  • 1
  • 1
Liz
  • 117
  • 2
  • 14
  • 1
    Have you tried anything? If so, please, provide the code, take a look to the [tour](http://stackoverflow.com/tour) and [how to ask](http://stackoverflow.com/help/how-to-ask). StackOverflow is not a "we code for you" service provider.[Introduction to VBA](https://blog.udemy.com/excel-macros-tutorial/) – Sgdva Jun 21 '16 at 21:00
  • Thanks for your response. I'm not looking for someone to provide code for me, but possibly a little guidance. I assumed that there would be a property of the listbox or multipage that I could easily change to solve this problem. I can provide a picture if that helps. I don't have much code for the launch of this userform, but I will show you what I have sine you would like to see it. – Liz Jun 22 '16 at 11:05

1 Answers1

0

You should handle the change event of the MultiPage (the object that handles the tab), following logic code should work, suit to your needs (this is in the UserForm code).

Private Sub MultiPage1_Change()
If MultiPage1.Value = 0 Then
ListBox1.Visible = True
Else
ListBox1.Visible = False
End If
End Sub

enter image description here

Sgdva
  • 2,800
  • 3
  • 17
  • 28
  • Thank you for your response. For some reason it is not working for me. I right clicked on the userform in my project tree, selected View Code and put it in exactly except for changing the name of the ListBox. I'm assuming my multipage1 name is the same, since I haven't changed it. Any ideas? Thanks for all your help. – Liz Jun 22 '16 at 14:58
  • you can check the name by selecting the item and check the [properties window](http://www.onlinepclearning.com/wp-content/uploads/2013/11/userform-name-620x153.png) – Sgdva Jun 22 '16 at 15:40