Results 1 to 2 of 2

Thread: Unload Userform protect sheet
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Oct 2008
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Unload Userform protect sheet

    I been searching the forums and I am sure this is quite easy to do but a little stumped. I have a userform where users only put in certain criteria. I have been asked to create a button where the user can unload the userform, and be able to print the worksheet, but the worksheet is protected. Anyone have any suggestions on how to do this?

    Code:
    Private Sub btnSEE_Click()
    Unload UserForm1
    ActiveSheet.Protect Password = "future"
    End Sub

  2. #2
    Legend VoG's Avatar
    Join Date
    Jun 2002
    Location
    127.0.0.1
    Posts
    63,651
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    8 Thread(s)

    Default Re: Unload Userform protect sheet

    Perhaps something like this

    Code:
    Private Sub btnSEE_Click()
    Unload UserForm1
    With ActiveSheet
        .Unprotect Password:="future"
        .PrintOut
        .Protect Password = "future"
    End With
    End Sub
    HTH, Peter
    Please test any code on a copy of your workbook.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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