Consulting

Results 1 to 5 of 5

Thread: Solved: How to open a form from another form

  1. #1

    Solved: How to open a form from another form

    Hi Anyone,

    I'm searching for a code to open a form from another form in excel 2007.

    Any help will be appreciated.

    Thanks
    Fiza

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    [vba]Private Sub CommandButton1_Click()
    UserForm2.Show
    End Sub
    [/vba]

    Also consider a MultiPage form if you're inputting data from both. It looks more "professional"

    BTW, Please do not rate your own question on posting it.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3

    Hi mdmakillop

    Thanks for the help. I really appreciate it. Ill take your advice to build up my form.Moreover I want to know how to modify the code if I wanted to open a worksheet from the form.Thanks in advance.

    Regards
    Fiza

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    To work on a sheet, you will need to open your form non-modally
    [vba]
    Userform1.Show False
    [/vba]
    To open another sheet
    [vba]

    Private Sub CommandButton2_Click()
    Sheets(2).Activate
    End Sub

    [/vba]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    Thanks for the help. It was really helpful.

Posting Permissions

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