Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
maxzsim
 
Posts: n/a
Default 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   Report Post  
John Mansfield
 
Posts: n/a
Default

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   Report Post  
Bob Phillips
 
Posts: n/a
Default


"John Mansfield" wrote in message
...

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i set up multi page user form Davidrowland88 Excel Discussion (Misc queries) 1 March 3rd 05 07:39 PM
user form static69 Excel Discussion (Misc queries) 1 February 6th 05 08:43 PM
Data Entry Alert in User Form Kev Excel Discussion (Misc queries) 6 January 8th 05 03:01 PM
restrict opening Excel file residing on a shared drive to one user k-ham Excel Discussion (Misc queries) 1 January 7th 05 01:57 AM
A "previous" button on a user form Anthony Slater Excel Discussion (Misc queries) 3 November 29th 04 05:57 PM


All times are GMT +1. The time now is 07:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"