+ Reply to Thread
Results 1 to 3 of 3

opening a user form

  1. #1
    maxzsim
    Guest

    opening a user form

    Hi,

    I have created a user form but
    1) how do i get it to run once i opened the excel file
    2) the user form will populate the data into a worksheet , but how do i make
    that worksheet to get the focus after the populate process

    appreciate any advise

    tks & rdgs

  2. #2
    John Mansfield
    Guest

    RE: opening a user form

    Assuming your userform is named UserForm1 . . . add this macro to a standard
    module to open the form:

    Sub OpenForm
    UserForm1.Show
    End Sub

    To get back to the worksheet, use this line of code to close the user form:

    Unload Me

    For example, if you wanted to close the form with a command button:

    Private Sub CommandButton1_Click()
    Unload Me
    End Sub

    ----------------------------
    Regards,
    John Mansfield
    http://www.pdbook.com


    "maxzsim" wrote:

    > Hi,
    >
    > I have created a user form but
    > 1) how do i get it to run once i opened the excel file
    > 2) the user form will populate the data into a worksheet , but how do i make
    > that worksheet to get the focus after the populate process
    >
    > appreciate any advise
    >
    > tks & rdgs


  3. #3
    Bob Phillips
    Guest

    Re: opening a user form


    "John Mansfield" <[email protected]> wrote in message
    news:[email protected]...

    > To get back to the worksheet, use this line of code to close the user

    form:
    >
    > Unload Me
    >
    > For example, if you wanted to close the form with a command button:
    >
    > Private Sub CommandButton1_Click()
    > Unload Me
    > End Sub


    Note that this is a command button on the form, the unload must be effected
    from the form.



+ 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