![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 20
|
I think I saw this somewhere but can't find it now.
I am looking for a way to get a macro to password protect a workbook with a predetermined password. Thanks Scott |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Huntington Beach, CA USA
Posts: 327
|
Hi Scott,
If you want to do this with a UserForm Try This: Option Explicit Private Sub Workbook_Open If TextBox1 = "your pw" Then "your code, what to do next" Unload Me Else If TextBox1 <> "your pw" Then Msg"Password Failed!" vbOkOnly + vbCritical End If End If End Sub James |
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Posts: 20
|
I may not have explained that real clearly, but I found what I wanted.
ActiveSheet.Protect("****") Thanks anyway. Scott |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|