View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Patrick Simonds Patrick Simonds is offline
external usenet poster
 
Posts: 258
Default MutiPage control question

Thanks for the reply.

I must admit that this was the second time I posted this, but did not get a
response, so I simplified it (maybe to much). Below I hope better describes
what it is I need to do.


I have 3 different worksheets and they each get their data from a different
Page on the MultiPage control. What I want to know is if the code below
could be altered in any way as to determine which page of the MultiPage
control has focus when the UserForm is opened? So lets say if line 1 of the
code below were to call the UserForm Page 1 of the MultiPage control would
have focus, but of line 2 were to all the UserForm then Page 3 of the
MultiPage control would have focus.


If Not Application.Intersect(Target, Range("E7:E11")) Is Nothing Then
Data_Input.Show
If Not Application.Intersect(Target, Range("E22")) Is Nothing Then
Data_Input.Show




"Dave Peterson" wrote in message
...
This should get you close:

Option Explicit
Private Sub UserForm_Initialize()
Me.MultiPage1.Value = 3
End Sub

But the first page is 0, so you might want .value = 2.

(I wasn't sure how you were starting your count.)

You may want to change the (Name) property for that page to Income, then
you
could use:

Option Explicit
Private Sub UserForm_Initialize()
With Me.MultiPage1
.Value = .Pages("Income").Index
End With
End Sub


And not worry about if that page ever changes position.

Patrick Simonds wrote:

This code opens the UserForm Data_Input when I click on a cell within the
range E7:E11. This UserForm has a MultiPage control on it and I want the
code below to open the UserForm and set the Focus to the "Income" page
(page 3) of the MultiPage control.

If Not Application.Intersect(Target, Range("E7:E11")) Is Nothing Then
Data_Input.Show


--

Dave Peterson