Unload Userform protect sheet

flavioso

New Member
Joined
Oct 29, 2008
Messages
20
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
 

Some videos you may like

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Perhaps something like this

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

Watch MrExcel Video

Forum statistics

Threads
1,118,887
Messages
5,574,839
Members
412,620
Latest member
sharma7s
Top