Show & hide Sheets - depending on true/false message input.

I have a shared work book that is accessed by every1 in the company... However only one sheet is relivant to 99% of them. So what i would like to do is create a macro that has a msg box popup on open and asks them to type in their password if they type in the word other than "password" i want it to hide all the sheets apart from one called "DRUMS". If they type in the word "password" i would like it to show all the sheets.

Any1 know how that could be done...????

Cheers

Phil

Posted by Dax on June 27, 2001 2:38 AM

Phil,

You can do this by putting code into the workbook module. Open the VB Editor (alt+F11), click View, Project Explorer if you can't see it already and then double click the ThisWorkbook icon. Some code like this should do what you want.

but, do u know if it is possible to make the letters in the msgBox stared out like ******** instead of the letter.

Cheers

Phil

Posted by Dax on June 27, 2001 3:14 AM

You can't make the inputbox display * rather than the actual characters typed. What you could do is create a simple userform with a textbox on it and carry out the same sheet hiding procedures. A textbox can be set to display * as the user types.

(9 responses) Hello all, I am new to the world of VBA and just started working on creating macros about 5 weeks ago. I have been watching YouTube videos a

Let's Connect

MrExcel.com debuted on November 21, 1998.

MrExcel.com provides examples of Formulas, Functions and Visual Basic procedures
for illustration only, without warranty either expressed or implied, including
but not limited to the implied warranties of merchantability and/or fitness for
a particular purpose. The Formulas, Functions and Visual Basic procedures on this
web site are provided "as is" and we do not guarantee that they can be used in all
situations.
This site contains affiliate links. Any affiliate commissions that we
earn when you click a link to Amazon or other sites is reinvested in keeping MrExcel.com
running. You can earn a commission for sales leads that you send to us by joining our
affiliate program.
View my Privacy Policy and Terms of Use.