ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hiding Sheets (https://www.excelbanter.com/excel-programming/407818-hiding-sheets.html)

millwalll

Hiding Sheets
 
Hi all.

So far I have a sheet and I Have a Form. I want to hide the sheet so that
soon as I open my file, all I want to see if the form. Is this possible ??


Thanks all......

Tom Hutchins

Hiding Sheets
 
You can hide Excel so only your userform is showing.

To hide Excel when the form as activated:
Private Sub UserForm_Activate()
'Hide Excel when this form is activated
Application.Visible = False
End Sub

To show Excel again when the form is unloaded (In this example, the code is
attached to a command button on the form).
Private Sub cmdExit_Click()
'Close the form and show Excel.
Unload Me
Application.Visible = True
End Sub

Hope this helps,

Hutch

"millwalll" wrote:

Hi all.

So far I have a sheet and I Have a Form. I want to hide the sheet so that
soon as I open my file, all I want to see if the form. Is this possible ??


Thanks all......


Lt. Bonifacius

Hiding Sheets
 

Hi! millwall.
Im not pretty sure about Excel been able to hide all sheets, but here's a
workaround if you dont mind displaying only one formated sheet.

1. In the Forms bar, click the Toogle Grid button so you wont the cells
border's, after that, select all the cells and fill them with some background
color you like. You can even rename the worksheet tab to " " (single space)
so it say nothing.
2. Open the Visual Basic Editor, you'll see a window called project and a
file called "ThisWorkbook", double clic on it, it will automatically open the
code editor, in the Object combo box, select Workbook, then in the procedure
combo box select the "Open" event. Excel automatically pastes some code like
this:

----------------------------------------------------------------------------------
Private Sub Workbook_Open()

End Sub
----------------------------------------------------------------------------------

3. Paste inside the sub this code:

----------------------------------------------------------------------------------
Sheet1.Visible = xlSheetHidden
UserForm1.Show
----------------------------------------------------------------------------------

4. It suposes you have two sheets, sheet1 is the one you want to hide, and
the other its the one you format. Hope it works for you.

millwalll

Hiding Sheets
 
I have tried this but dont seem to be working what I have is in micrsoft
visual basic I have form called Software_form then I have a spreadsheet
called data I want to if possible total hide the data speadsheet so when the
user double clcik the excel file all they see if the Software_form.

I dont want the user to see the spreadsheet form at all that only goona be
for my viewing and updating they dont need to know about it...

"Lt. Bonifacius" wrote:


Hi! millwall.
Im not pretty sure about Excel been able to hide all sheets, but here's a
workaround if you dont mind displaying only one formated sheet.

1. In the Forms bar, click the Toogle Grid button so you wont the cells
border's, after that, select all the cells and fill them with some background
color you like. You can even rename the worksheet tab to " " (single space)
so it say nothing.
2. Open the Visual Basic Editor, you'll see a window called project and a
file called "ThisWorkbook", double clic on it, it will automatically open the
code editor, in the Object combo box, select Workbook, then in the procedure
combo box select the "Open" event. Excel automatically pastes some code like
this:

----------------------------------------------------------------------------------
Private Sub Workbook_Open()

End Sub
----------------------------------------------------------------------------------

3. Paste inside the sub this code:

----------------------------------------------------------------------------------
Sheet1.Visible = xlSheetHidden
UserForm1.Show
----------------------------------------------------------------------------------

4. It suposes you have two sheets, sheet1 is the one you want to hide, and
the other its the one you format. Hope it works for you.



All times are GMT +1. The time now is 08:36 AM.

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