ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide/Unhide with passwortd prompt (https://www.excelbanter.com/excel-programming/351237-hide-unhide-passwortd-prompt.html)

David Duggan

Hide/Unhide with passwortd prompt
 
I'm working on a spreadsheet for my employer that has a number of sheets
that need to be hidden from some users, but visible to others (e.g. costs).
All users need to be abler to make changes, but only some will see ceratin
areas.

The restricted users are mobile sales people working with laptops.

The workbook is currently set up with all sheets but one hidden and I am
using command buttons with macros to navigate in the workbook and
hide/unhide the sheets.

How can I set this so that users' are prompted for a password when they want
to access certain areas.

Thanks

DRD



ben

Hide/Unhide with passwortd prompt
 
you could have an input box pop up when they want to access the sheets, with
a password specified in code, or a userform with a 'masked' textbox
(neither really secure)

sub commandbutton1_click()
select case inputbox("Please enterpassword","Password")
case "mypassword"
code to show hidden sheet
case else
msgbox "I'm sorry that is an incorrect password"
exit sub
end select
end sub
--
When you lose your mind, you free your life.


"David Duggan" wrote:

I'm working on a spreadsheet for my employer that has a number of sheets
that need to be hidden from some users, but visible to others (e.g. costs).
All users need to be abler to make changes, but only some will see ceratin
areas.

The restricted users are mobile sales people working with laptops.

The workbook is currently set up with all sheets but one hidden and I am
using command buttons with macros to navigate in the workbook and
hide/unhide the sheets.

How can I set this so that users' are prompted for a password when they want
to access certain areas.

Thanks

DRD




David Duggan

Hide/Unhide with passwortd prompt
 
This works except for the fact that the password appears in the Input Box in
clear text rather using characters such as asteriks. I have a form built
that works, except that I would need a number of forms for this
spreadsheet.

If I could declare a variable and then use the variable to call a specific
macro, I can build all my requirements into one form. That's where I am
right now, but I'm having problems with it. Maybe just syntax, I don't know.

Thanks for the help.

DRD

"ben" (remove this if mailing direct) wrote in message
...
you could have an input box pop up when they want to access the sheets,
with
a password specified in code, or a userform with a 'masked' textbox
(neither really secure)

sub commandbutton1_click()
select case inputbox("Please enterpassword","Password")
case "mypassword"
code to show hidden sheet
case else
msgbox "I'm sorry that is an incorrect password"
exit sub
end select
end sub
--
When you lose your mind, you free your life.


"David Duggan" wrote:

I'm working on a spreadsheet for my employer that has a number of sheets
that need to be hidden from some users, but visible to others (e.g.
costs).
All users need to be abler to make changes, but only some will see
ceratin
areas.

The restricted users are mobile sales people working with laptops.

The workbook is currently set up with all sheets but one hidden and I am
using command buttons with macros to navigate in the workbook and
hide/unhide the sheets.

How can I set this so that users' are prompted for a password when they
want
to access certain areas.

Thanks

DRD







All times are GMT +1. The time now is 02:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com