View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Userform Question

Say you have 5 forms that are really similar. You could put the common elements
on the top of the form and then use a multipage control on the bottom.

Each page would be used to retrieve some set of parms from the user.

I created a test userform with a label at the top of the form. Then I added a
multipage control to the bottom portion.

Then I added a few pages (right click on a page tab and choose add).

Then I used this code to test it:

Option Explicit
Private Sub UserForm_Initialize()

Dim myVal As Long
Dim iCtr As Long

'decide which one to show
myVal = 2

With Me.MultiPage1
.Style = fmTabStyleNone

For iCtr = 0 To .Pages.Count - 1
.Pages(iCtr).Visible = CBool(iCtr = myVal)
Next iCtr
End With

End Sub

The .style setting hides all the stuff you don't want the user to see (stuff for
other forms).



Ryan wrote:

Dennis,

I'm sorry I am still pretty new to VBA and am having trouble understanding what you are saying. Can you please break it down further for me?

Ryan


--

Dave Peterson