View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
PCLIVE PCLIVE is offline
external usenet poster
 
Posts: 29
Default run macro on opening

You need your code in ThisWorkbook. Use this.

Private Sub Workbook_Open()
With Worksheets("sheet1")
Protect Password:="test", userinterfaceonly:=True
EnableAutoFilter = True
End With
End Sub

HTH,
Paul

"brian thompson3001 via OfficeKB.com" <u15682@uwe wrote in message
news:6a855ded5e2ae@uwe...
Hi
(originally put in wrong grouping)

I have go this off other threads, but would like it to run automatically
when
opening the workbook. I am not up to speed with these codes, and
therefore
ask if the additional line/lines could be added in the correct place, in
order that I can copy and Paste. Currently, I have to run this every time
after opening the workbook

Option Explicit
Sub auto_open()
With Worksheets("sheet1")
Protect Password:="test", userinterfaceonly:=True
EnableAutoFilter = True
End With

End Sub

Can anyone help?,

Brian

--
bnt

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200612/1