Hi All, A little odd question that I am sure you all will know the answer to a lot quicker than me! Ive got an excel spreadsheet which I use to track all my christmas purchases for family etc including the presents I have purchased for my girlfriend. Is there a solution that runs a specific macro based on the password that is entered upon opening the document? For example... I give my girlfriend the password "christmastree" and I have a seperate password "password". If she enters "christmastree" it then runs the macro "hannahview" which hides all the info relating to her so she can see other purchased and update her additions. If I enter "password" then it runs the macro "normalview" which gives me all the information etc. Dont know if it is possible or if it is outside the realms of excel/my ability. Cheers Matt
Alternative approach. Have a sheet with everything except hers on it, then have a separate sheet with her stuff on it that she doesn't know about?
I did think of this but then I would need to update two sheets...hmmm I will look at what I can do. Thank you for your reply
Not based on the actual password you use. but you could easily knock up a 'fake' password macro to hide/unhide relevant sheets. Or, for a simpler option, just hide your sheet and set protection settings to prevent unhiding (if neccessary, it sounds like an ease of input thing rather than a confidentiality thing?) If you have seperate windows usernames you can define a new function: Function UserNameWindows() As String UserName = Environ("USERNAME") End Function then call that from a cell to return the currently logged on windows user.
You could create a rule in your version of the workbook that automatically populates a censored version of the list, then create an external reference in her version that draws from the censored list in your workbook: http://office.microsoft.com/en-gb/e...ll-range-in-another-workbook-HP010102338.aspx I assume you're going for obfuscation rather than full locked down security EDIT: Actually something along these lines would probably be neater and simpler: Here looks useful if you want it a bit slicker: http://www.mrexcel.com/forum/excel-questions/81080-hide-sheet-password-protect.html
Thanks guys that works great! Ive now changed it so that the hannahview macro runs on opening and then a password is required to run the two normal and admin view macros. Everything else is hidden and locked unless a password is entered. Im sure she could find all the data if she wanted but it would just ruin her christmas haha!