LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 13
Default VBA password protect

Hi

I have got this macro to run when opening. All works, but when I password
protect the sheet, and then close and open i get a run error.

I am not fluent with VBA and get by by recording and pasting other work off
the treads

Can anyone let me have the VBA code for protect / unprotect. and where it
should be entered in the code below . The password is "template"

thanks in advance

Private Sub auto_Open()
Sub averagesort()
Range("A6:AI36").Select
Selection.Sort Key1:=Range("C6"), Order1:=xlDescending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlBottomToTop
ActiveWindow.ScrollRow = 6
Range("A3").Select
End Sub


Signature


bnt

--
bnt

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...l-new/200607/1
 
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
How can I password protect a hidden column in Excel? Ira.Stoller Excel Worksheet Functions 9 April 24th 23 07:42 PM
Can I protect all excel tabs in a file with one password entry? Indiana born Excel Discussion (Misc queries) 40 December 17th 09 01:54 PM
Using VB to password protect, but sheet remains visible JennyJeneralGraves Excel Discussion (Misc queries) 0 March 30th 06 02:12 AM
Password Protect Dedrie Excel Worksheet Functions 0 August 19th 05 07:03 PM
Auto Protect workbook with password upon opening Brian Excel Worksheet Functions 0 February 23rd 05 05:45 PM


All times are GMT +1. The time now is 01:32 PM.

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"