+ Reply to Thread
Results 1 to 5 of 5

load userform from a combobox in another userform

  1. #1
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    load userform from a combobox in another userform

    Hi there,

    I have a wbook with 2 different userform (1 and 2)

    I have a combobox in userform 1 that can be filled with numbers from 1 to 10.

    in userform 2 i have 10 frames.

    I need to load userform 2 after filling the combobox in userform 1

    i.e. If i select "5" in the combobox, it should load the 2nd userform with 5 frames visible.

    Can anyone help me with this? would it help if i post my workbook?

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: load userform from a combobox in another userform

    I can't see the need for two userforms, but attach the workbook
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: load userform from a combobox in another userform

    Hello ncaravela,

    Assuming your Frames are named Frame1, Frame2, ... Frame10 then this will work.

    UserForm1 Code - Place this in the General/Declarations section.
    Please Login or Register  to view this content.

    UserForm2 Code
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: load userform from a combobox in another userform

    in userform1 a combobox1 and a commandbutton1

    Please Login or Register  to view this content.
    In Userform2 in the Initialize-event:

    Please Login or Register  to view this content.
    Last edited by snb; 09-17-2010 at 05:38 AM.



  5. #5
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    Re: load userform from a combobox in another userform

    Thanks all for your help.
    however, i'm having some trouble with the code that Leith Ross ent me.
    I can't load the second userform when i choose the number in the cbonumero of the first userform.

    I'm loading the wb with the code already in it.

    Please, if possible, tell me one other thing (Don't mean to push).
    I need that the data loaded from the 1st userform goes to the next empty row in the ws "Base Dados", but i also need that the data inserted in the 2nd userform goes to the following rows, under columns (M to P). Is this possible?
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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