Results 1 to 1 of 1

vba to hide / unhide separate sheets based on password (bis)

Threaded View

  1. #1
    Registered User
    Join Date
    03-26-2011
    Location
    Oslo
    MS-Off Ver
    Excel 2007
    Posts
    4

    vba to hide / unhide separate sheets based on password (bis)

    Hi All,

    I looked at Royuk's workbook in a thread http://www.excelforum.com/excel-prog...-password.htmlthat is called the same ... (without "bis" )and it suits quite well to my purposes! Thanks Roy!

    There is just 1 thing I would like to change:
    A specific user gets only his/her dedicated sheet visible. My users would need access to several sheets ..depending on their "lvl". Not just 1 sheet.

    I tampered a little with Roy's original code:
                    sLevel = cl.Offset(0, 2).Value
                    MsgBox "Correct Information Entered.  Please Proceed.", vbOKOnly + _
                                                                            vbInformation, "Correct Information entered."
                    Sheets("Splash").Visible = xlSheetVisible
                    bOK = True
                    Sheets(sLevel).Visible = xlSheetVisible
                    Unload Me
    and changed it into:
    MsgBox "Correct Information Entered.  Please Proceed.", vbOKOnly + _
                                                                            vbInformation, "Correct Information entered."
                    Sheets("Splash").Visible = xlSheetVisible
                    
                    For Col = 2 To nCols 'sige
                    sLevel = cl.Offset(0, Col).Value
                    
                    Sheets(sLevel).Visible = xlSheetVisible
                    Next Col
                    bOK = True
                    Unload Me
    it seems to show the sheets I intended(...) Though the Userform does not seems to unload now.



    Also ... is there a way to prevent changing the sheetname? This would royally mess up the functionality.

    Hope you can help
    Sige
    Last edited by sigeg; 03-26-2011 at 05:28 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1