PDA

View Full Version : Multipage Control in UserForm



andytpl
02-24-2009, 07:28 AM
Hi there,

I have created a multipage userform in a worksheet. Actually only 2 pages. I want to provide some form of control which page is displayed depending on the location of the cursor. In my case I want to display Page 1 if the cursor is anywhere in Column B from row 20 onwards and Page 2 if the cursor is anywhere in Column D from row 20 onwards. I have read somewhere on the Web how this can be done but I am not well verse enough to get it done. I hope some help from this forum. Thx.

Bob Phillips
02-24-2009, 07:32 AM
Just use



MultiPage1.Value = 0


for page 1, etc.

andytpl
02-24-2009, 07:44 AM
I don't quite understand how to incorporate your suggestion into the set of codes I am using right now. Please help.


If Activecell.Row > 20 AND Activecell.Column = 2 Then

Userform1.Show

Elseif Activecell.Row > 20 AND Activecell.Column = 4 Then

Userform1.Show

Else

Msgbox "Please Select Appropriate Cells"

End If

Bob Phillips
02-24-2009, 07:46 AM
Un tested



If Activecell.Row > 20 AND Activecell.Column = 2 Then

With Userform1

.Multipage1.Value = 0
.Show
End With

Elseif Activecell.Row > 20 AND Activecell.Column = 4 Then

With Userform1

.Multipage1.Value = 1
.Show
End With

Else

Msgbox "Please Select Appropriate Cells"

End If

andytpl
02-24-2009, 08:02 AM
Thank you very much. You are a life saver. :bow: