ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   hide sheet tab (https://www.excelbanter.com/excel-programming/295136-hide-sheet-tab.html)

gav meredith

hide sheet tab
 
Hi,

i have a workbook with which i want one of the sheets to not be viewed
without a password. Is this possible?? I dont simply want to hide the sheet
as a person could unhide it. The contents of the sheet are not for all eyes.

Any suggestions????? Cheers!!!!



kkknie[_42_]

hide sheet tab
 
In code you can use:

Sheets("Sheet1").Visible = xlVeryHidden

Although, anyone who knows how to write code can unhide it if you don'
put a password on it somewhere. I do this a lot since most of my user
are not very "sophisticated".



--
Message posted from http://www.ExcelForum.com


Vasant Nanavati

hide sheet tab
 
You can hide the sheet and then protect the workbook (not the worksheet)
with a passsword.

--

Vasant

"gav meredith" wrote in message
...
Hi,

i have a workbook with which i want one of the sheets to not be viewed
without a password. Is this possible?? I dont simply want to hide the

sheet
as a person could unhide it. The contents of the sheet are not for all

eyes.

Any suggestions????? Cheers!!!!





gav meredith

hide sheet tab
 
yes but the person accessing the workbook could still unhide the sheet. All
should have access to the workbook but only a few should have access to the
hidden sheet. It is the contents of this sheet that i want hidden from a
select few......

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
You can hide the sheet and then protect the workbook (not the worksheet)
with a passsword.

--

Vasant

"gav meredith" wrote in message
...
Hi,

i have a workbook with which i want one of the sheets to not be viewed
without a password. Is this possible?? I dont simply want to hide the

sheet
as a person could unhide it. The contents of the sheet are not for all

eyes.

Any suggestions????? Cheers!!!!







Vasant Nanavati

hide sheet tab
 
I didn't say *save* the workbook with a password; I said *protect* it.

Tools | Protection | Protect Workbook

after you hide the worksheet.

--

Vasant



"gav meredith" wrote in message
...
yes but the person accessing the workbook could still unhide the sheet.

All
should have access to the workbook but only a few should have access to

the
hidden sheet. It is the contents of this sheet that i want hidden from a
select few......

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
You can hide the sheet and then protect the workbook (not the worksheet)
with a passsword.

--

Vasant

"gav meredith" wrote in message
...
Hi,

i have a workbook with which i want one of the sheets to not be viewed
without a password. Is this possible?? I dont simply want to hide the

sheet
as a person could unhide it. The contents of the sheet are not for all

eyes.

Any suggestions????? Cheers!!!!









Chris

hide sheet tab
 
in your projects window go to ThisWorkbook and in your code window''s left dropdown box choose WorkBook, Right dropdown box choose SheetActivate. Then put in this code

Private Sub Workbook_SheetActivate(ByVal Sh As Object) "this will be generated for you


If Sh.Name = "My Hide Sheet Name" Then Worksheets("My Default Sheet Name").Activat

End Sub "this will be generated for you


----- gav meredith wrote: ----

Hi

i have a workbook with which i want one of the sheets to not be viewe
without a password. Is this possible?? I dont simply want to hide the shee
as a person could unhide it. The contents of the sheet are not for all eyes

Any suggestions????? Cheers!!!




Chris

hide sheet tab
 
you can put a inputbox function in also to act as a passwor

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "My Hide Sheet Name" Then
x = inputbox("Input Password")
if x = YourPassword Then Exit Su
Worksheets("My Default Sheet Name").Activat
end if
End Sub

----- chris wrote: ----

in your projects window go to ThisWorkbook and in your code window''s left dropdown box choose WorkBook, Right dropdown box choose SheetActivate. Then put in this code


Private Sub Workbook_SheetActivate(ByVal Sh As Object) "this will be generated for you


If Sh.Name = "My Hide Sheet Name" Then Worksheets("My Default Sheet Name").Activat


End Sub "this will be generated for you



----- gav meredith wrote: ----

Hi

i have a workbook with which i want one of the sheets to not be viewe
without a password. Is this possible?? I dont simply want to hide the shee
as a person could unhide it. The contents of the sheet are not for all eyes

Any suggestions????? Cheers!!!




Don Guillett[_4_]

hide sheet tab
 
If sheet is hidden with very hidden then it can only be unhidden with code.
And, if the code is protected they would have a hard time, especially if
they didn't know the ws name.

--
Don Guillett
SalesAid Software

"gav meredith" wrote in message
...
yes but the person accessing the workbook could still unhide the sheet.

All
should have access to the workbook but only a few should have access to

the
hidden sheet. It is the contents of this sheet that i want hidden from a
select few......

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
You can hide the sheet and then protect the workbook (not the worksheet)
with a passsword.

--

Vasant

"gav meredith" wrote in message
...
Hi,

i have a workbook with which i want one of the sheets to not be viewed
without a password. Is this possible?? I dont simply want to hide the

sheet
as a person could unhide it. The contents of the sheet are not for all

eyes.

Any suggestions????? Cheers!!!!









gav meredith

hide sheet tab
 
um, neither did i???? When a person unprotects the workbook they could then
unhide the sheet anyway. The idea is to give certain users access to this
particular worksheet within the workbook....

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
I didn't say *save* the workbook with a password; I said *protect* it.

Tools | Protection | Protect Workbook

after you hide the worksheet.

--

Vasant



"gav meredith" wrote in message
...
yes but the person accessing the workbook could still unhide the sheet.

All
should have access to the workbook but only a few should have access to

the
hidden sheet. It is the contents of this sheet that i want hidden from a
select few......

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
You can hide the sheet and then protect the workbook (not the

worksheet)
with a passsword.

--

Vasant

"gav meredith" wrote in message
...
Hi,

i have a workbook with which i want one of the sheets to not be

viewed
without a password. Is this possible?? I dont simply want to hide

the
sheet
as a person could unhide it. The contents of the sheet are not for

all
eyes.

Any suggestions????? Cheers!!!!











Vasant Nanavati

hide sheet tab
 
I guess one of us is not understanding the other clearly.

Why would you give the non-authorized users the password to unprotect the
workbook?

Workbook protection protects only the structure of the workbook. This means
that without the password, users cannot insert, delete, hide, unhide or
rename worksheets.
They can do whatever else they would do with an unprotected workbook.

--

Vasant



"gav meredith" wrote in message
...
um, neither did i???? When a person unprotects the workbook they could

then
unhide the sheet anyway. The idea is to give certain users access to this
particular worksheet within the workbook....

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
I didn't say *save* the workbook with a password; I said *protect* it.

Tools | Protection | Protect Workbook

after you hide the worksheet.

--

Vasant



"gav meredith" wrote in message
...
yes but the person accessing the workbook could still unhide the

sheet.
All
should have access to the workbook but only a few should have access

to
the
hidden sheet. It is the contents of this sheet that i want hidden from

a
select few......

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
You can hide the sheet and then protect the workbook (not the

worksheet)
with a passsword.

--

Vasant

"gav meredith" wrote in message
...
Hi,

i have a workbook with which i want one of the sheets to not be

viewed
without a password. Is this possible?? I dont simply want to hide

the
sheet
as a person could unhide it. The contents of the sheet are not for

all
eyes.

Any suggestions????? Cheers!!!!













gav meredith

hide sheet tab
 
they both sound good.......could you explain a little more on how to
implement them???
"chris" wrote in message
...
you can put a inputbox function in also to act as a password

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "My Hide Sheet Name" Then
x = inputbox("Input Password")
if x = YourPassword Then Exit Sub
Worksheets("My Default Sheet Name").Activate
end if
End Sub

----- chris wrote: -----

in your projects window go to ThisWorkbook and in your code window''s

left dropdown box choose WorkBook, Right dropdown box choose SheetActivate.
Then put in this code:


Private Sub Workbook_SheetActivate(ByVal Sh As Object) "this

will be generated for you"


If Sh.Name = "My Hide Sheet Name" Then Worksheets("My

Default Sheet Name").Activate


End Sub "this will be generated for you"



----- gav meredith wrote: -----

Hi,

i have a workbook with which i want one of the sheets to not be

viewed
without a password. Is this possible?? I dont simply want to

hide the sheet
as a person could unhide it. The contents of the sheet are not

for all eyes.

Any suggestions????? Cheers!!!!






gav meredith

hide sheet tab
 
that is correct. The users are to be able to alter certain parts of the
workbook but NOT one particular sheet. This sheet basically is to be
accessed by users with a particular security level. They do need to amend
certain parts of the workbook. All i am after is for a sheet called VKnew to
be hidden.
"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
I guess one of us is not understanding the other clearly.

Why would you give the non-authorized users the password to unprotect the
workbook?

Workbook protection protects only the structure of the workbook. This

means
that without the password, users cannot insert, delete, hide, unhide or
rename worksheets.
They can do whatever else they would do with an unprotected workbook.

--

Vasant



"gav meredith" wrote in message
...
um, neither did i???? When a person unprotects the workbook they could

then
unhide the sheet anyway. The idea is to give certain users access to

this
particular worksheet within the workbook....

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
I didn't say *save* the workbook with a password; I said *protect* it.

Tools | Protection | Protect Workbook

after you hide the worksheet.

--

Vasant



"gav meredith" wrote in message
...
yes but the person accessing the workbook could still unhide the

sheet.
All
should have access to the workbook but only a few should have access

to
the
hidden sheet. It is the contents of this sheet that i want hidden

from
a
select few......

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
You can hide the sheet and then protect the workbook (not the

worksheet)
with a passsword.

--

Vasant

"gav meredith" wrote in message
...
Hi,

i have a workbook with which i want one of the sheets to not be

viewed
without a password. Is this possible?? I dont simply want to

hide
the
sheet
as a person could unhide it. The contents of the sheet are not

for
all
eyes.

Any suggestions????? Cheers!!!!















Chris

hide sheet tab
 
1 more thing: your gonna have to do something like this to prevent the enduser from seeing the data on the sheet while the inputbox is up

If UCase(Sh.Name) = "My Hide Sheet Name" The
Y = Sh.Columns(1).ColumnWidt
Sh.Columns(1).ColumnWidth = 500 (a huge number so they Can't see whats on the whole sheet
x = InputBox("pass word"
If x = "DOG" The
Sh.Columns(1).ColumnWidth =
Exit Su
End I
Sh.Columns(1).ColumnWidth =
Worksheets("My Default Sheet Name").Activat
End I

----- chris wrote: ----

you can put a inputbox function in also to act as a passwor

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "My Hide Sheet Name" Then
x = inputbox("Input Password")
if x = YourPassword Then Exit Su
Worksheets("My Default Sheet Name").Activat
end if
End Sub

----- chris wrote: ----

in your projects window go to ThisWorkbook and in your code window''s left dropdown box choose WorkBook, Right dropdown box choose SheetActivate. Then put in this code


Private Sub Workbook_SheetActivate(ByVal Sh As Object) "this will be generated for you


If Sh.Name = "My Hide Sheet Name" Then Worksheets("My Default Sheet Name").Activat


End Sub "this will be generated for you



----- gav meredith wrote: ----

Hi

i have a workbook with which i want one of the sheets to not be viewe
without a password. Is this possible?? I dont simply want to hide the shee
as a person could unhide it. The contents of the sheet are not for all eyes

Any suggestions????? Cheers!!!




Vasant Nanavati

hide sheet tab
 
Chris, in both your solutions the users are still able to see the worksheet,
in the first case by holding the mouse button down on the sheet tab, and in
the second case while the input box is on the screen. They may not be able
to activate it and do anything with it but they can certainly view the
contents (unless you have other code that moves the cellpointer to an unused
part of the sheet when it is activated, which would be inconvenient for the
authorized users).

--

Vasant

"chris" wrote in message
...
you can put a inputbox function in also to act as a password

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "My Hide Sheet Name" Then
x = inputbox("Input Password")
if x = YourPassword Then Exit Sub
Worksheets("My Default Sheet Name").Activate
end if
End Sub

----- chris wrote: -----

in your projects window go to ThisWorkbook and in your code window''s

left dropdown box choose WorkBook, Right dropdown box choose SheetActivate.
Then put in this code:


Private Sub Workbook_SheetActivate(ByVal Sh As Object) "this

will be generated for you"


If Sh.Name = "My Hide Sheet Name" Then Worksheets("My

Default Sheet Name").Activate


End Sub "this will be generated for you"



----- gav meredith wrote: -----

Hi,

i have a workbook with which i want one of the sheets to not be

viewed
without a password. Is this possible?? I dont simply want to

hide the sheet
as a person could unhide it. The contents of the sheet are not

for all eyes.

Any suggestions????? Cheers!!!!






gav meredith

hide sheet tab
 
not a problem...thank you!!! Could you please elaborate a bit more on the
input box and how to implement this code?????
"chris" wrote in message
...
1 more thing: your gonna have to do something like this to prevent the

enduser from seeing the data on the sheet while the inputbox is up.

If UCase(Sh.Name) = "My Hide Sheet Name" Then
Y = Sh.Columns(1).ColumnWidth
Sh.Columns(1).ColumnWidth = 500 (a huge number so they Can't see

whats on the whole sheet)
x = InputBox("pass word")
If x = "DOG" Then
Sh.Columns(1).ColumnWidth = Y
Exit Sub
End If
Sh.Columns(1).ColumnWidth = Y
Worksheets("My Default Sheet Name").Activate
End If

----- chris wrote: -----

you can put a inputbox function in also to act as a password

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "My Hide Sheet Name" Then
x = inputbox("Input Password")
if x = YourPassword Then Exit Sub
Worksheets("My Default Sheet Name").Activate
end if
End Sub

----- chris wrote: -----

in your projects window go to ThisWorkbook and in your code

window''s left dropdown box choose WorkBook, Right dropdown box choose
SheetActivate. Then put in this code:


Private Sub Workbook_SheetActivate(ByVal Sh As Object)

"this will be generated for you"


If Sh.Name = "My Hide Sheet Name" Then Worksheets("My

Default Sheet Name").Activate


End Sub "this will be generated for you"



----- gav meredith wrote: -----

Hi,

i have a workbook with which i want one of the sheets to

not be viewed
without a password. Is this possible?? I dont simply want

to hide the sheet
as a person could unhide it. The contents of the sheet are

not for all eyes.

Any suggestions????? Cheers!!!!






Vasant Nanavati

hide sheet tab
 
My solution will do exactly what you want to accomplish. Why don't you try
it first?

Don's solution is also practical and easy to implement but does not give
authorized users an easy way to view the sheet with a password.

Chris's amended solution will also work but is too complicated, in my view,
for the simple task you want to accomplish.

Try the proposed solutions before you second-guess! This is not a difficult
problem.

--

Vasant






"gav meredith" wrote in message
...
that is correct. The users are to be able to alter certain parts of the
workbook but NOT one particular sheet. This sheet basically is to be
accessed by users with a particular security level. They do need to amend
certain parts of the workbook. All i am after is for a sheet called VKnew

to
be hidden.
"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
I guess one of us is not understanding the other clearly.

Why would you give the non-authorized users the password to unprotect

the
workbook?

Workbook protection protects only the structure of the workbook. This

means
that without the password, users cannot insert, delete, hide, unhide or
rename worksheets.
They can do whatever else they would do with an unprotected workbook.

--

Vasant



"gav meredith" wrote in message
...
um, neither did i???? When a person unprotects the workbook they could

then
unhide the sheet anyway. The idea is to give certain users access to

this
particular worksheet within the workbook....

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
I didn't say *save* the workbook with a password; I said *protect*

it.

Tools | Protection | Protect Workbook

after you hide the worksheet.

--

Vasant



"gav meredith" wrote in message
...
yes but the person accessing the workbook could still unhide the

sheet.
All
should have access to the workbook but only a few should have

access
to
the
hidden sheet. It is the contents of this sheet that i want hidden

from
a
select few......

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
You can hide the sheet and then protect the workbook (not the
worksheet)
with a passsword.

--

Vasant

"gav meredith" wrote in message
...
Hi,

i have a workbook with which i want one of the sheets to not

be
viewed
without a password. Is this possible?? I dont simply want to

hide
the
sheet
as a person could unhide it. The contents of the sheet are not

for
all
eyes.

Any suggestions????? Cheers!!!!

















gav meredith

hide sheet tab
 
aha, now that is what i dont want. I dont want the user to be able to see
the VKnew sheet but do want them to access the others.......
"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Chris, in both your solutions the users are still able to see the

worksheet,
in the first case by holding the mouse button down on the sheet tab, and

in
the second case while the input box is on the screen. They may not be able
to activate it and do anything with it but they can certainly view the
contents (unless you have other code that moves the cellpointer to an

unused
part of the sheet when it is activated, which would be inconvenient for

the
authorized users).

--

Vasant

"chris" wrote in message
...
you can put a inputbox function in also to act as a password

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "My Hide Sheet Name" Then
x = inputbox("Input Password")
if x = YourPassword Then Exit Sub
Worksheets("My Default Sheet Name").Activate
end if
End Sub

----- chris wrote: -----

in your projects window go to ThisWorkbook and in your code

window''s
left dropdown box choose WorkBook, Right dropdown box choose

SheetActivate.
Then put in this code:


Private Sub Workbook_SheetActivate(ByVal Sh As Object) "this

will be generated for you"


If Sh.Name = "My Hide Sheet Name" Then Worksheets("My

Default Sheet Name").Activate


End Sub "this will be generated for you"



----- gav meredith wrote: -----

Hi,

i have a workbook with which i want one of the sheets to not

be
viewed
without a password. Is this possible?? I dont simply want to

hide the sheet
as a person could unhide it. The contents of the sheet are not

for all eyes.

Any suggestions????? Cheers!!!!








gav meredith

hide sheet tab
 
vasant, that seems to do the trick...thank you!!!!!
and thanks to everybody else also!!!!
"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Chris, in both your solutions the users are still able to see the

worksheet,
in the first case by holding the mouse button down on the sheet tab, and

in
the second case while the input box is on the screen. They may not be able
to activate it and do anything with it but they can certainly view the
contents (unless you have other code that moves the cellpointer to an

unused
part of the sheet when it is activated, which would be inconvenient for

the
authorized users).

--

Vasant

"chris" wrote in message
...
you can put a inputbox function in also to act as a password

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "My Hide Sheet Name" Then
x = inputbox("Input Password")
if x = YourPassword Then Exit Sub
Worksheets("My Default Sheet Name").Activate
end if
End Sub

----- chris wrote: -----

in your projects window go to ThisWorkbook and in your code

window''s
left dropdown box choose WorkBook, Right dropdown box choose

SheetActivate.
Then put in this code:


Private Sub Workbook_SheetActivate(ByVal Sh As Object) "this

will be generated for you"


If Sh.Name = "My Hide Sheet Name" Then Worksheets("My

Default Sheet Name").Activate


End Sub "this will be generated for you"



----- gav meredith wrote: -----

Hi,

i have a workbook with which i want one of the sheets to not

be
viewed
without a password. Is this possible?? I dont simply want to

hide the sheet
as a person could unhide it. The contents of the sheet are not

for all eyes.

Any suggestions????? Cheers!!!!








Gord Dibben

hide sheet tab
 
gav

My 2 cents worth.

There are three types of protection and passwording(4 if you count VBA
projects)

1. Sheet Protection is what you need to "lock" or "unlock" cells for
editing. Can be passworded.

Protecting elements from all users. You can prevent users from inserting,
deleting, and formatting rows and columns, from changing the contents of
locked cells, and from moving the cursor to cells that are locked or to cells
that are unlocked.

Each sheet must be done individually unless you use a Macro.

2. Workbook Protection is used to lock the structure. This is what Vasant
is referring to. Can be passworded.

You can prevent users from adding or deleting worksheets, or displaying hidden
worksheets. You can also prevent users from changing the sizes or positions of
the windows you set up to display a workbook. These protections apply to the
entire workbook. This does not protect the sheet from editing.

3. Then there is File Protection. You put a password on the file so it
cannot be opened with out the PW.

To prevent anyone from viewing an Excel file you need to password-protect the
file from being opened in the first place.

XL97.....FileSave AsOptionsPassword to open

XL2002...FileSave AsToolsGeneral OptionsPassword to open

Gord Dibben Excel MVP


On Thu, 15 Apr 2004 10:33:40 +1000, "gav meredith" wrote:

um, neither did i???? When a person unprotects the workbook they could then
unhide the sheet anyway. The idea is to give certain users access to this
particular worksheet within the workbook....

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
I didn't say *save* the workbook with a password; I said *protect* it.

Tools | Protection | Protect Workbook

after you hide the worksheet.

--

Vasant



"gav meredith" wrote in message
...
yes but the person accessing the workbook could still unhide the sheet.

All
should have access to the workbook but only a few should have access to

the
hidden sheet. It is the contents of this sheet that i want hidden from a
select few......

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
You can hide the sheet and then protect the workbook (not the

worksheet)
with a passsword.

--

Vasant

"gav meredith" wrote in message
...
Hi,

i have a workbook with which i want one of the sheets to not be

viewed
without a password. Is this possible?? I dont simply want to hide

the
sheet
as a person could unhide it. The contents of the sheet are not for

all
eyes.

Any suggestions????? Cheers!!!!












All times are GMT +1. The time now is 10:23 AM.

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