View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Henry[_4_] Henry[_4_] is offline
external usenet poster
 
Posts: 72
Default Running sheet from another sheet ... and back

Przemek,

Private Sub CloseButton_Click()
ActiveWorkbook.Save ' saving myfile.xls
Unload WprowadzDaneFaktury

Workbooks("first.xls").Sheets("Startform").activat e
End Sub

To show a form when a worksheet is activated

In the worksheet code put
Private Sub Worksheet_Activate()
myform.show
End Sub

If you size your form full screen, the worksheet will be hidden behind it.

To show a form when the workbook is opened

Insert a module and put the following code into it:
Private Sub Auto_Open()
myform.show
End Sub

HTH
Henry

"Przemek Wrzesinski" wrote in message
...
Hi,
I've got one sheet (let's call it first.xls) with userform, which runs

other
sheet:

Private Sub RegisterButton_Click()
Workbooks.Open Filename:= "myfile.xls"
Unload Startform ' hiding first userform
Windows("myfile.xls").Activate

End Sub

In the sheet myfile.xls I've got another userform (opens on loading),

which
helps input new data to the sheet. My problem is, that I don't know how to
make macro, which could save & close myfile.xls and return user to my
first.xls and run again Startform, smtg like this:

Private Sub CloseButton_Click()
ActiveWorkbook.Save ' saving myfile.xls
Unload WprowadzDaneFaktury
Worksheets(first.xls).Startform.Show ' it stops here :(
End Sub

BTW How to open sheet and showing only startform without sheet ?

TIA

Przemek
--
mors(at)morsik(dot)net