ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Protection in Excel - how do i hide some info. from some users? (https://www.excelbanter.com/excel-discussion-misc-queries/52948-protection-excel-how-do-i-hide-some-info-some-users.html)

michael

Protection in Excel - how do i hide some info. from some users?
 
I need to protect a workbook that will hide some of the information from
several users but will show this information to other users. it is very urgent

Peter Rooney

Protection in Excel - how do i hide some info. from some users?
 
Michael,

Try something like this:

Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "********"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "MyPassword" Then
Exit Sub
Else
'Unprotect your ranges etc
End If

End Sub

On;y the prople who know "Mypassword" will be able to reveal the hidden
renges, columns, rows etc.

Hope this helps

Pete

"michael" wrote:

I need to protect a workbook that will hide some of the information from
several users but will show this information to other users. it is very urgent


michael

Protection in Excel - how do i hide some info. from some users
 
hi,

lets say i have a table o 5 coulmns:
A-E and i i have information in all the columns, but i whant that some of
the users will not be able to see the data in coulms D and E. how do i do
this.

"Peter Rooney" wrote:

Michael,

Try something like this:

Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "********"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "MyPassword" Then
Exit Sub
Else
'Unprotect your ranges etc
End If

End Sub

On;y the prople who know "Mypassword" will be able to reveal the hidden
renges, columns, rows etc.

Hope this helps

Pete

"michael" wrote:

I need to protect a workbook that will hide some of the information from
several users but will show this information to other users. it is very urgent


michael

Protection in Excel - how do i hide some info. from some users
 
hi,

I reccive an error message in VB


"Peter Rooney" wrote:

Michael,

Try something like this:

Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "********"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "MyPassword" Then
Exit Sub
Else
'Unprotect your ranges etc
End If

End Sub

On;y the prople who know "Mypassword" will be able to reveal the hidden
renges, columns, rows etc.

Hope this helps

Pete

"michael" wrote:

I need to protect a workbook that will hide some of the information from
several users but will show this information to other users. it is very urgent


Peter Rooney

Protection in Excel - how do i hide some info. from some users
 
Michael,

It really all depend on how secure you want your columns to be.

You could hide the columns with the following:

Columns("D:E").EntireColumn.Hidden = true

and use the opposite command to unhide them in the macro I gave you earlier:

Columns("D:E").EntireColumn.Hidden = false

But this doesn't stop a user from manually unhiding the columns.

To counteract this, you could hide the column headers thus:

ActiveWindow.DisplayHeadings = False

but this doesn't stop somebody from redisplaying them via Tools-Options-View!

To really go for it, you have to have a macro that runs as soon as you open
your workbook that hides the columns, then customizes the menu to remove the
"Tools" command!

Somthing like this, perhaps:

Private Sub Workbook_Open()
ScreenSetup '(this can be anything - it's just the name of a procedure
you call)
End Sub

This goes in the "ThisWorkBook" code sheet, with ScreenSetup containing all
the procedures you need to customise your worksheet.

You need to remember to reset all the Excel settings you've changed before
you close the workbook, with the following macro that also goes in the
ThisWorkBook code sheet.

Private Sub Workbook_BeforeClose(cancel As Boolean)
ScreenReset '(this too can be anything - it's just the name of your
procedure)
End Sub

Try recording yourself changing the display and menu to your requirements
and pasting the resulting code into the two macros above, and opening and
closing your workbook to see what happens.

Hope this helps

pete





"michael" wrote:

hi,

lets say i have a table o 5 coulmns:
A-E and i i have information in all the columns, but i whant that some of
the users will not be able to see the data in coulms D and E. how do i do
this.

"Peter Rooney" wrote:

Michael,

Try something like this:

Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "********"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "MyPassword" Then
Exit Sub
Else
'Unprotect your ranges etc
End If

End Sub

On;y the prople who know "Mypassword" will be able to reveal the hidden
renges, columns, rows etc.

Hope this helps

Pete

"michael" wrote:

I need to protect a workbook that will hide some of the information from
several users but will show this information to other users. it is very urgent


Peter Rooney

Protection in Excel - how do i hide some info. from some users
 
Can you tell me what the message was?



"michael" wrote:

hi,

I reccive an error message in VB


"Peter Rooney" wrote:

Michael,

Try something like this:

Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "********"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "MyPassword" Then
Exit Sub
Else
'Unprotect your ranges etc
End If

End Sub

On;y the prople who know "Mypassword" will be able to reveal the hidden
renges, columns, rows etc.

Hope this helps

Pete

"michael" wrote:

I need to protect a workbook that will hide some of the information from
several users but will show this information to other users. it is very urgent


michael

Protection in Excel - how do i hide some info. from some users
 
thanks but this is not what i need, i need the users not to see in specific
columns and specific cells and othe need to see them. this is for DB that
some of the data in specific rows are restricted for some other users and the
other information in the row is not restricted, also the information in other
rows is not restricted in all the row. how can you help me with this.

"Peter Rooney" wrote:

Michael,

It really all depend on how secure you want your columns to be.

You could hide the columns with the following:

Columns("D:E").EntireColumn.Hidden = true

and use the opposite command to unhide them in the macro I gave you earlier:

Columns("D:E").EntireColumn.Hidden = false

But this doesn't stop a user from manually unhiding the columns.

To counteract this, you could hide the column headers thus:

ActiveWindow.DisplayHeadings = False

but this doesn't stop somebody from redisplaying them via Tools-Options-View!

To really go for it, you have to have a macro that runs as soon as you open
your workbook that hides the columns, then customizes the menu to remove the
"Tools" command!

Somthing like this, perhaps:

Private Sub Workbook_Open()
ScreenSetup '(this can be anything - it's just the name of a procedure
you call)
End Sub

This goes in the "ThisWorkBook" code sheet, with ScreenSetup containing all
the procedures you need to customise your worksheet.

You need to remember to reset all the Excel settings you've changed before
you close the workbook, with the following macro that also goes in the
ThisWorkBook code sheet.

Private Sub Workbook_BeforeClose(cancel As Boolean)
ScreenReset '(this too can be anything - it's just the name of your
procedure)
End Sub

Try recording yourself changing the display and menu to your requirements
and pasting the resulting code into the two macros above, and opening and
closing your workbook to see what happens.

Hope this helps

pete





"michael" wrote:

hi,

lets say i have a table o 5 coulmns:
A-E and i i have information in all the columns, but i whant that some of
the users will not be able to see the data in coulms D and E. how do i do
this.

"Peter Rooney" wrote:

Michael,

Try something like this:

Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "********"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "MyPassword" Then
Exit Sub
Else
'Unprotect your ranges etc
End If

End Sub

On;y the prople who know "Mypassword" will be able to reveal the hidden
renges, columns, rows etc.

Hope this helps

Pete

"michael" wrote:

I need to protect a workbook that will hide some of the information from
several users but will show this information to other users. it is very urgent


michael

Protection in Excel - how do i hide some info. from some users
 
Compile error:

member already exist in an object module from wich this object module derives

"Peter Rooney" wrote:

Can you tell me what the message was?



"michael" wrote:

hi,

I reccive an error message in VB


"Peter Rooney" wrote:

Michael,

Try something like this:

Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "********"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "MyPassword" Then
Exit Sub
Else
'Unprotect your ranges etc
End If

End Sub

On;y the prople who know "Mypassword" will be able to reveal the hidden
renges, columns, rows etc.

Hope this helps

Pete

"michael" wrote:

I need to protect a workbook that will hide some of the information from
several users but will show this information to other users. it is very urgent


Gord Dibben

Protection in Excel - how do i hide some info. from some users?
 
Michael

Be aware that sheet and workbook passwords are easily cracked.

If you don't want certain users to see information, do not include that
information in your workbook.


Gord Dibben Excel MVP

On Mon, 31 Oct 2005 03:48:03 -0800, Peter Rooney
wrote:

Michael,

Try something like this:

Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "********"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "MyPassword" Then
Exit Sub
Else
'Unprotect your ranges etc
End If

End Sub

On;y the prople who know "Mypassword" will be able to reveal the hidden
renges, columns, rows etc.

Hope this helps

Pete

"michael" wrote:

I need to protect a workbook that will hide some of the information from
several users but will show this information to other users. it is very urgent



michael

Protection in Excel - how do i hide some info. from some users
 
i know that the password are esaly cracked however the users that use this
worksheet are not that sofisticated and i also will protect the VBA Project
in a diffrent password so they will not be able to see the password. but i
need this information on one spreadsheet and i want to find a way to give for
some users the ability to see all the information and other users not to see
all the information (i.e. Salary and benefits)

"Gord Dibben" wrote:

Michael

Be aware that sheet and workbook passwords are easily cracked.

If you don't want certain users to see information, do not include that
information in your workbook.


Gord Dibben Excel MVP

On Mon, 31 Oct 2005 03:48:03 -0800, Peter Rooney
wrote:

Michael,

Try something like this:

Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "********"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "MyPassword" Then
Exit Sub
Else
'Unprotect your ranges etc
End If

End Sub

On;y the prople who know "Mypassword" will be able to reveal the hidden
renges, columns, rows etc.

Hope this helps

Pete

"michael" wrote:

I need to protect a workbook that will hide some of the information from
several users but will show this information to other users. it is very urgent




Peter Rooney

Protection in Excel - how do i hide some info. from some users
 
Michael,

I'm stumped. Your error message has exceeded the tiny boundaries of my
technical knowledge. Sorry :-)

However, here's something else. Put this line of code in your Worksheet_Open
macro to prevent users going to your VBA code via Alt+F11 and finding your
passwords.

Application.OnKey "%{F11}", ""

make sure that before you close the workbook, you include the line

Application.OnKey "%{F11}"

to reset the function of Alt+F11

If you add the following line to the beginning of a code module

Option Private Module

This will prevent any macro names contained in that code sheet being
displayed when you do Alt+F8 (run macro)

You can also disable/enable Alt+F8 in a similar way to the Alt+F11 example
above.

Hope this is of some use

Pete



"michael" wrote:

Compile error:

member already exist in an object module from wich this object module derives

"Peter Rooney" wrote:

Can you tell me what the message was?



"michael" wrote:

hi,

I reccive an error message in VB


"Peter Rooney" wrote:

Michael,

Try something like this:

Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "********"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "MyPassword" Then
Exit Sub
Else
'Unprotect your ranges etc
End If

End Sub

On;y the prople who know "Mypassword" will be able to reveal the hidden
renges, columns, rows etc.

Hope this helps

Pete

"michael" wrote:

I need to protect a workbook that will hide some of the information from
several users but will show this information to other users. it is very urgent


Dave Peterson

Protection in Excel - how do i hide some info. from some users
 
If I were putting salaries and benefits in an excel workbook, I surely wouldnt
share it with others. All it takes is one curious person to make that
information available to lots of people.

But I'm just repeating Gord's warning...

michael wrote:

i know that the password are esaly cracked however the users that use this
worksheet are not that sofisticated and i also will protect the VBA Project
in a diffrent password so they will not be able to see the password. but i
need this information on one spreadsheet and i want to find a way to give for
some users the ability to see all the information and other users not to see
all the information (i.e. Salary and benefits)

"Gord Dibben" wrote:

Michael

Be aware that sheet and workbook passwords are easily cracked.

If you don't want certain users to see information, do not include that
information in your workbook.


Gord Dibben Excel MVP

On Mon, 31 Oct 2005 03:48:03 -0800, Peter Rooney
wrote:

Michael,

Try something like this:

Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "********"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "MyPassword" Then
Exit Sub
Else
'Unprotect your ranges etc
End If

End Sub

On;y the prople who know "Mypassword" will be able to reveal the hidden
renges, columns, rows etc.

Hope this helps

Pete

"michael" wrote:

I need to protect a workbook that will hide some of the information from
several users but will show this information to other users. it is very urgent




--

Dave Peterson

David

Protection in Excel - how do i hide some info. from some users
 
I tried using your code. The box came up, I entered my password (wages) and
nothing happened. What did I do wrong? Here is the code I used:

Public Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "******"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "wages" Then
Exit Sub
Else
Call ChangeWageFlagForm
End If

End Sub

"Peter Rooney" wrote:

Michael,

Try something like this:

Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "********"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "MyPassword" Then
Exit Sub
Else
'Unprotect your ranges etc
End If

End Sub

On;y the prople who know "Mypassword" will be able to reveal the hidden
renges, columns, rows etc.

Hope this helps

Pete

"michael" wrote:

I need to protect a workbook that will hide some of the information from
several users but will show this information to other users. it is very urgent


Dave Peterson

Protection in Excel - how do i hide some info. from some users
 
What does ChangeWageFlagForm do?

And just to double check, you may want to add a message if the password is
incorrect.

If ReturnedPassword < "wages" Then
MsgBox "Wrong Password!"
Exit Sub
Else
Call ChangeWageFlagForm
End If

David wrote:

I tried using your code. The box came up, I entered my password (wages) and
nothing happened. What did I do wrong? Here is the code I used:

Public Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "******"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "wages" Then
Exit Sub
Else
Call ChangeWageFlagForm
End If

End Sub

"Peter Rooney" wrote:

Michael,

Try something like this:

Sub Password()

Message = "Enter Password"
Title = "Restricted User Mode"
DefaultPassword = "********"
ReturnedPassword = UCase(InputBox(Message, Title, DefaultPassword))

If ReturnedPassword < "MyPassword" Then
Exit Sub
Else
'Unprotect your ranges etc
End If

End Sub

On;y the prople who know "Mypassword" will be able to reveal the hidden
renges, columns, rows etc.

Hope this helps

Pete

"michael" wrote:

I need to protect a workbook that will hide some of the information from
several users but will show this information to other users. it is very urgent


--

Dave Peterson


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

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