+ Reply to Thread
Results 1 to 14 of 14

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

  1. #1
    michael
    Guest

    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

  2. #2
    Peter Rooney
    Guest

    RE: 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


  3. #3
    michael
    Guest

    RE: 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


  4. #4
    michael
    Guest

    RE: 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


  5. #5
    Peter Rooney
    Guest

    RE: 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


  6. #6
    Peter Rooney
    Guest

    RE: 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


  7. #7
    michael
    Guest

    RE: 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


  8. #8
    michael
    Guest

    RE: 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


  9. #9
    Gord Dibben
    Guest

    Re: 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
    <[email protected]> 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



  10. #10
    michael
    Guest

    Re: 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
    > <[email protected]> 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

    >
    >


  11. #11
    Peter Rooney
    Guest

    RE: 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


  12. #12
    Dave Peterson
    Guest

    Re: 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
    > > <[email protected]> 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

  13. #13
    David
    Guest

    RE: 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


  14. #14
    Dave Peterson
    Guest

    Re: 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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1