LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Automatic Protecting Question

Right now i have it so when a user opens the spreadsheet it asks them 2
questions

then after it filters based on the value the user entered it automatically
password protects it.

The problem is that when a user saves the spreadsheet and then comes back to
it the program gives them an error since its trying to protect an already
protected sheet.

How can i make it so it bypasses this part? any ideas?

Heres my Code:


Private Sub Workbook_Open()

UserForm2.Show


Dim Message1, Title1, MyValues
Message = "Please enter your name (First and Last)"
Title = "Name" '<--Change
MyValues = InputBox(Message, Title)
Sheets("Summary").Range("E8") = MyValues

Dim Message2, Title2, MyValue
Message = "Please Enter Last 5 Digits of Your Card Number"
Title = "AMEX Number" '<--Change
MyValue = InputBox(Message, Title)

If MyValue = "" Then
Sheets("Expense Amex").Protect password:="welcome"
Exit Sub

End If


Range("Cardholder_Number").AutoFilter
Range("Cardholder_Number").AutoFilter Field:=1, Criteria1:=MyValue,
visibleDropDown:=False
Sheets("Expense Amex").Protect password:="welcome"
On Error Resume Next


End Sub


Thanks,
Alex


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about protecting P D Sterling New Users to Excel 2 June 27th 08 11:39 PM
Question about protecting a formula. tgcali Excel Discussion (Misc queries) 3 April 22nd 08 04:05 PM
Protecting a Worksheet Question Les Stout[_2_] Excel Programming 1 February 28th 08 02:20 PM
automatic column sorting problem when protecting sheet Montana Excel Worksheet Functions 3 May 17th 07 09:55 AM
Question about protecting charts Lauren Giles Excel Discussion (Misc queries) 2 March 2nd 07 12:34 AM


All times are GMT +1. The time now is 01:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"