How to have a userform displayed and be able to work in a different spreadsheet

  • Thread starter Thread starter Valeria
  • Start date Start date
V

Valeria

Dear experts,
I would like to run a macro contained in Worksheet B from
Worksheet A.
I need to keep the macro in worksheet B, so I can't just
copy the modules in worksheet A, and as this is part of a
series of steps and macros etc. I have used a userform
with a button linked to worksheet B.
My problem is the following: the userform stays visible
after clicking the worksheet B button and does not allow
me to work in worksheet B. I can't just hide the userform
or unload it as I need it for the following steps of my
process!

If it's useful the very simple code I have used is:
in the module:
Sub Show_Userform()
UserForm1.Show 0
End Sub
in the userform:
Private Sub CommandButton1_Click()
Workbooks.Open ("WorksheetB.xls")
End Sub

Do you maybe know how to solve this problem?
Many thanks in advance!
Best regards,
Valeria
 
If you are using Excel 2000 or above the following will
allow the userform to stay visible and allow you to work
at the same time.

UserForm1.Show vbModeless

Regards
Jamal
 
Back
Top