PDA

View Full Version : Solved: How to open a form from another form



fiza
03-20-2010, 04:24 AM
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

mdmackillop
03-20-2010, 04:32 AM
Private Sub CommandButton1_Click()
UserForm2.Show
End Sub


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.

fiza
03-20-2010, 04:52 AM
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

mdmackillop
03-20-2010, 05:06 AM
To work on a sheet, you will need to open your form non-modally


Userform1.Show False


To open another sheet



Private Sub CommandButton2_Click()

Sheets(2).Activate
End Sub

fiza
03-20-2010, 05:09 AM
Thanks for the help. It was really helpful.