magikmel;
Suggestion 1. Indent you code, so it's easier to follow, like this:
It's a lot easier to see that you have 'If P = "test"' twice, and that the 2nd one will never occur.
1 On_close and on_save I need to hide columns ‘D to J” across sheets 2,3,4,5, return to first sheet and protect workbook. (So confidential details are always hidden from read only users).
In menus goto Tools->Options->Security to password protect the Workbook
These won't solve all your problems, but they will get you started
2 On_open I need a password prompt to unprotect workbook and unhide columns ‘D to J” across sheets 2,3,4,5 so I will not have to go to tools, protection, unprotect - select rows and unhide each sheet every time I need to add data.
Everyone will have to enter a passwork to open the workbook, and then it will also ask everyone to enter a 2nd password to unhide the columns. If you don't want it to ask every one the 2nd password, you can put an empty file on your local computer and have Workbook_Open() look for that file, and when it finds it, then just automatically unhide the columns, and leave them hidden for anyone who doesn't have that file on their local computer..
3 And finally I have a password code on the summary sheet that reveals the password when typed! Is there a line I can add to the code below that will **** it out? (It’s protecting pivot tables; I needed a workaround to avoid the warning ‘cant update pivot table when protected’)
Don't know of anyway to hide what is typed into an input box. But you could try telling them to type the password code into a cell (A25000), and format the cell's .Interior.ColorIndex and .Font.ColorIndex the same color so the text is invisible and use this code
Bookmarks