English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have one form build on one excel sheet. Whenver i open excel sheet , the active workbook opens and then above that, form opens. I need to hide the worksheet in given excel sheet so that whenever i will open excel sheet , only form should visible......
How to do that?
Please help me
Thanks in advance

2007-01-01 23:00:33 · 4 answers · asked by SAM 1 in Computers & Internet Software

4 answers

In Microsoft Excel, you can hide sheets in a workbook so that a user cannot see them. You can hide any type of sheet in a workbook, but you must always leave at least one sheet visible.

add this code
worksheets("sheet.name"). visible = false
(visible can be true, false or xlveryhidden)

Follow this link for more details
http://support.microsoft.com/?scid=kb%3Ben-us%3B213609&x=16&y=12

2007-01-01 23:24:58 · answer #1 · answered by Anonymous · 0 0

Renaud's answer is good. It's a simple way by going to Format > Sheet > Hide. If you are wanting to use VBA code, an easier way of doing it with VBA code is to use:

Sheets("Sheet1").Visible = xlVeryHidden

Sheet1 would be the name of the sheet being hidden.

If you are wanting the sheet so that other people cannot get to it, see it, and make changes, then use the xlVeryHidden then lock your VBA code so it can't be changed. This will allow only you to view and change the hidden worksheet. If you set the Visible property to false or hide it like Renaud said other people can still find it, open it, and change it. They'd have to be somewhat Excel knowledgable to find it if it is regularly hidden (Renaud's method or seting Visible property to false, but with the method I stated only you or whoever has the correct password could change it.

2007-01-03 05:13:02 · answer #2 · answered by devilishblueyes 7 · 0 0

You don't need VBA code to hide a sheet. It can be done manually, with: Format menu > Sheet > Hide.

But if you absolutely need VBA code, turn on the macro recorder before you execute the manual steps: it will create the VBA code you need. You will then need to move the VBA code to the 'ThisWorkbook' module inside the following routine header:

Private Sub Workbook_Open()
' Put VBA code here
End Sub

This will ensure that the code is run every time the workbook is open,

Good luck

2007-01-02 01:13:26 · answer #3 · answered by Renaud 3 · 0 0

Since Yahoo Answers format the answer text box incorrectly, I cannot write the code out properly here, but follow the URL I have given below to read up on this...

you could use:
Globals.Sheet1.Visible_
=Excel._
XlSheetVisibility.xlSheetHidden

or

CType(Globals.ThisWorkbook._
Sheets(1),Excel.Worksheet) ._
Visible = Excel.XlSheetVisibility._
xlSheetHidden

2007-01-01 23:11:37 · answer #4 · answered by Anonymous · 0 0

fedest.com, questions and answers