+ Reply to Thread
Results 1 to 6 of 6

How to Hide a column from one of the users accessing a shared WorkBook

  1. #1
    Registered User
    Join Date
    12-16-2007
    Posts
    3

    How to Hide a column from one of the users accessing a shared WorkBook

    Hi,
    I want to ask If the following feature is available

    I have an Excel Sheet shared on a network,
    Three users can acess it
    I want to hide one of the columns from one of the users

    What is the simplest way to do so ?

    Thanks,

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    The simplest way would be to hide that column and then protect the worksheet. Then give the 3 users who should have access to that column the unprotect password. After opening the sheet they can unprotect the sheet and unhide the column.

    They just need to make sure they re-hide the column and protect the sheet when they're done.

    Another option would be to use a macro in the Workbook_Open event that asks for a password. If the correct password is entered the sheet will show the column, otherwise it will stay hidden.

  3. #3
    Registered User
    Join Date
    12-16-2007
    Posts
    3

    How to prevent Unhiding the column

    Thanks for the reply,
    I was able to add code that check the Username or the Machine name,
    if they belong to the user that has to be denied from viewing the column
    I hide that column .
    BUT how can i prevent that user from Unhiding that column.
    Which event handles the Hiding and Unhiding process?

    If there is no event to handle this case,
    Is there any else to do so (Prevent the user from Unhiding the column)

    Thanks,

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Hiding a column does not guarantee a user can not get access to that column

    Try hiding a column with data in it
    Use F5 - Goto command
    Enter a cell address for any cell in the hidden column - or even the entire column a:a

    Ctr + C to copy
    Select another cell or column
    PasteSpecial > Values

    You may need to look at a Worksheet_SelectionChange macro to test what column the cell selected is in. & this will not work if Macro Security is set to hight
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  5. #5
    Registered User
    Join Date
    12-16-2007
    Posts
    3
    Well that means that I cant handle the following case:

    Workbook : 1
    Users: A, B and C

    I cant prevent User C from viewing a column in Workbook 1
    While A and B can still view it

    Do i need to create another workbook (2) for user C.
    If so, How can i update Workbook 1 with the data entered by user C from Workbook 2

    If any one have a better idea for a case like this , that will be great

    Thanks for the reply anyway

  6. #6
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Another option

    There is a VBA command that hides a sheet so that it can not be seen by a normal Excel user

    Maybe you could put the data into a 2nd sheet
    Hide the sheet before Save with a Workbook_BeforeSave macro

    Unhide the sheet based on Username or the Machine name,

    To hide sheet use
    Please Login or Register  to view this content.

+ 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