View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sean Sean is offline
external usenet poster
 
Posts: 454
Default Do 3 Tasks on Opening File Q

Thanks Corey but get a Goto Debug on

Application.GoTo Reference:=sh.Range("a1"), Scroll:=True


Corey wrote:

Try:


Private Sub Workbook_Open()
Application.ScreenUpdating = False
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
Unprotect Password:="1234"
Application.GoTo Reference:=sh.Range("a1"), Scroll:=True
Next
ThisWorkbook.Sheets("Current Week").Select
Application.ScreenUpdating = True
ActiveWindow.Zoom = 75

Range("C6").Select

End Sub

The Sheets will be left Unprotected though....

Corey....

"Sean" wrote in message
ps.com...
I am trying to do 3 things when I open up a file

1) Unprotect all worksheets in the file
2) Go to A1 in all sheets
3) Finally activate C6 in the sheet Current week

I had 2 & 3 above working and I tried adding 1 above, but am hitting
debug so I guess I have some syntax wrong




Private Sub Workbook_Open()
Application.ScreenUpdating = False
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets

ws.unProtect Password:="1234"

Next Dim sh As Worksheet

Dim sh As Worksheet

For Each sh In ThisWorkbook.Worksheets
sh.Select
Application.GoTo Reference:=sh.Range("a1"), Scroll:=True
Next sh
ThisWorkbook.Sheets("Current Week").Select
Application.ScreenUpdating = True
ActiveWindow.Zoom = 75

Range("C6").Select

End Sub