ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Running sheet from another sheet ... and back (https://www.excelbanter.com/excel-programming/271111-re-running-sheet-another-sheet-back.html)

Henry[_4_]

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





All times are GMT +1. The time now is 02:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com