Results 1 to 3 of 3

Userform_initialize, select Multipage tab based on which previous userform button pressed?

Threaded View

  1. #1
    Registered User
    Join Date
    09-04-2013
    Location
    york
    MS-Off Ver
    Excel 2013
    Posts
    8

    Userform_initialize, select Multipage tab based on which previous userform button pressed?

    Hi All,

    I am fairly new to userform's so any help would be greatly appreciated.

    Scenario - I have two userform's in excel 2013, when a button ("CommandButton3" or "CommandButton5") on the first userform (MasterPage1) is pressed it opens a second userform (Layer12) which contains a multipage. I want to select a certain tab, based on which button was pressed on the previous userform.

    my code:
    Private Sub UserForm_Initialize()
    
    Select Case Application.Caller
    Case "CommandButton3"
    '1st tab
    Me.MultiPage1.Value = 0
    '3rd tab
    Case "CommandButton5"
    Me.MultiPage1.Value = 3
    End Select
    
    End Sub
    I have also tried:

    Private Sub UserForm_Initialize()
    
    If MasterPage1.CommandButton3.Value = True Then
        Me.MultiPage1.Value = 0
    ElseIf MasterPage1.CommandButton5.Value = True Then
        Me.MultiPage1.Value = 3
    
    End If
    
    End Sub
    Neither work.
    Any suggestions as to where I am going wrong would be appreciated.

    Many Thanks,
    Jonathan
    Last edited by arlu1201; 09-06-2013 at 01:57 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Back button on a multipage userform
    By qball in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2021, 05:02 AM
  2. Select specific MultiPage in a UserForm with other pages grayed out
    By onmyway in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-04-2012, 02:56 PM
  3. Error when previous button clicked when on First Multipage
    By jwala in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-04-2010, 12:44 AM
  4. [SOLVED] select [a1]cell when hotkey(ctrl+q) pressed, after userform load
    By x taol in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2006, 06:10 PM
  5. [SOLVED] Userform, multipage, select a tab
    By Jos Vens in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2005, 01:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1