want form to open without seeing worksheet

  • Thread starter Thread starter Ruth
  • Start date Start date
R

Ruth

Hi there

I have a file that when opened a form automatically opens. The code I used
is:


Private Sub Workbook_Open()
frmCaptain.Show
End Sub

I want it to open so the user just sees the form until they select a
worksheet from the combo box on the form. The combo box on the form is
already in place and working.


In other words, I don't want the worksheets to show when the file is opened,
just the form should show. Then the worksheet can show once selected on the
form.

Is this possible? if so, how?
 
hi
a workbook must contain at least 1 visible sheet so it's not possible to
hide all sheets until one is selected.
i would recomend that you select a "default start point" and open the
workbook to that point.
Private Sub Workbook_Open()
frmCaptain.Show
sheets("sheet1").activate 'pick your own
cellls(1,1).activate
End Sub

regards
FSt1
 
hi
afterthought
it might be better to select the sheet and cell first then show the form.
Private Sub Workbook_Open()
sheets("sheet1").activate 'pick your own
cellls(1,1).activate
frmCaptain.Show
End Sub

regards
FSt1
 
Is it possible to make the form REALLY big; size it to total hide the Excel
application??
 
You can hide the Excel application when your form is displayed. Put this code
in the form's code module:

Private Sub UserForm_Activate()
'Hide Excel when this form is activated
Application.Visible = False
End Sub

When the user has selected a worksheet from the combobox, you will need some
event code like this (in the form's code module):

Application.Visible = True
Sheets("SelectedSheet").Activate
Unload Me

Be sure to include the Application.Visible = True statement before unloading
the form, or you will have a hidden instance of Excel running.

Hope this helps,

Hutch
 
Thank-you - that worked.
--
Thank-you!
Ruth


Tom Hutchins said:
You can hide the Excel application when your form is displayed. Put this code
in the form's code module:

Private Sub UserForm_Activate()
'Hide Excel when this form is activated
Application.Visible = False
End Sub

When the user has selected a worksheet from the combobox, you will need some
event code like this (in the form's code module):

Application.Visible = True
Sheets("SelectedSheet").Activate
Unload Me

Be sure to include the Application.Visible = True statement before unloading
the form, or you will have a hidden instance of Excel running.

Hope this helps,

Hutch
 
Back
Top