Consulting

Results 1 to 5 of 5

Thread: Multipage Control in UserForm

  1. #1
    VBAX Regular
    Joined
    Jul 2007
    Posts
    78
    Location

    Multipage Control in UserForm

    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.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Just use

    [vba]

    MultiPage1.Value = 0
    [/vba]

    for page 1, etc.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Jul 2007
    Posts
    78
    Location
    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

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Un tested

    [vba]

    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
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Regular
    Joined
    Jul 2007
    Posts
    78
    Location
    Thank you very much. You are a life saver.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •