How can I unhide certain "pre-hidden" worksheets when a user-input cell in a worksheet is equal to a certain value, e.g. the name of cell value equals to the worksheet name?
How can I unhide certain "pre-hidden" worksheets when a user-input cell in a worksheet is equal to a certain value, e.g. the name of cell value equals to the worksheet name?
It needs to be done with VB, however this piece of code will run every time you make the slightest change to your spreadsheet.
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("a1") = "sample" Then
ThisWorkbook.Unprotect "password"
Sheets("HiddenSheet").Visible = 2 'Un-Hide sheet
ThisWorkbook.Protect "password" 'Re-protect workbook
End If
End Sub
If you dont protect the workbook, it can be manually un-hidden but also you need to lock the VBA Properties else you could simply check the VB code to see what the workbook password is, too.
Also bear in mind how it might play out it people are set to high security (unsigned macros automatically turned off).
Last edited by widemonk; 03-29-2005 at 04:21 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks