Excel VBA question - showing userform when opening workbook

  • Thread starter Thread starter ajliaks
  • Start date Start date
A

ajliaks

Hi,

I created a userform called "Choose".
I need to show this userform when I open the workbook.

How is the code to do that?
I tried writting in "This Workbook" something like:

Dim Choose As UserForm
Private Sub Workbook_Open()
Application.Choose_Open
End Sub


I also need to called another userform called "Import" when clickin
cmdProceed in Choose UserForm, I've tried this:

Private Sub cmdProceed_Click()
If OptionImport.Value = True Then
UserForm.Initialize (Importing)
Else
If OptionExport.Value = True Then
UserForm.Open (Exporting)
End If
End If
'Unload me
End Sub

Thanks
 
Hi,
I created a userform called "Choose".
I need to show this userform when I open the workbook.

How is the code to do that?
I tried writting in "This Workbook" something like:

Try with

Private Sub Workbook_Open()
Choose.Show
End Sub
I also need to called another userform called "Import" when clicking
cmdProceed in Choose UserForm>
Thanks.
Try

Private Sub cmdProceed_Click()
Import.Show
End Sub

if you just need to initialize it, as your code suggests, try with

Load Import
 
You have the right idea about where to call the form, but the way to d
it is:

Private Sub Workbook_Open()
Choose.Show
End Sub

- Piku
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top