PDA

View Full Version : See only relevant data based on user and password login



hunsnowboard
12-27-2009, 04:11 AM
Hi Everyone!

I am quite new to VBA, I was already able to write some very very basic macros (thanks to this site) but now I am facing a problem which I cannot even begin.
In brief the problem is the following:
I have an excel file which is viewed by many people. Those people should see the data relevant only for them in the sheet, they should not see the data relevant for others. My idea is that each people should have a personal password and when they log in with their personal password a macro lists the records only relevant to them.

More detailed description of the problem: I have an excel file with multiple sheets containing data. On each sheet there are two columns (F, K) which contains the information relevant to people. (Right now there are three different type of records in these columns: KM, DD and blank cells.) When the file is opened I would need to work like this: a form should pop up with a combo list for user: KM or DD and beneath an input box for the password (password for KM should be 111; password for DD should be 222). Then when the user is selected and the password is typed in correctly the excel file should open. In case of KM user login, the user should see only the records where the column F and K has the value: KM. In this case blanks and DD values should be ignored and not to be seen by the user KM. The KM user should see only those rows (in each sheet as there are multiple sheets) where the column F and K has the KM value in it.

Of course if the DD user logs in he should see only those rows which contain DD int he F and K columns, on each sheet.

I hope you understood my problem and can help me because I even don’t know how to begin! :dunno For easier understanding I attached a test excel file , where You can see what I mean.

Thank You very much in advance and I wish You all Happy Holidays! :xmas:

Jan Karel Pieterse
12-27-2009, 11:42 PM
How sensitive is the information in question? Excel's worksheet protection is very simple to break, so you can never assume your data is safe from prying eyes.

hunsnowboard
12-28-2009, 02:23 AM
Hi Karel! Thank you for your reply! The information is not very sensitive. The users of the excel file are very basic excel users.

Jan Karel Pieterse
12-28-2009, 03:12 AM
See attached.
If you consider using this, hide the "Other" worksheet, so people cannot view the passwords.