LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default referencing multiple worksheets in macro

So I kind of found the answer to my question in a post from a couple years
ago but am still confused so if anyone could help I'd appreciate it...I'm
trying to protect the sheet while still being able to use the subtotal
function. I have several worksheets I want to do this for and this is the
post from before with the code but I can't figure out where to put the names
of my worksheets ("01","02","03") and what I need to customize in the code
for my file. Any suggestions?

Option Explicit
Sub auto_open()
dim wks as worksheet
for each wks in thisworkbook.worksheets
with wks
.select 'see note below
.Protect Password:="hi", userinterfaceonly:=True
.EnableOutlining = True
.EnableAutoFilter = True
End With
application.goto thisworkbook.worksheets(1).range("a1"), scroll:=true
End Sub

Tom Ogilvy has reported that sometimes protecting sheets will work better if
it's selected first.

Change the application.goto line to where you want to goto <vbg when the
code
ends.
 
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
Cell Referencing between multiple worksheets Nelson B. Excel Discussion (Misc queries) 4 July 24th 09 08:55 AM
Referencing cells in multiple worksheets Andrew W Excel Discussion (Misc queries) 3 August 6th 08 02:23 PM
Excel 2003 Referencing multiple worksheets EdGarrett Excel Discussion (Misc queries) 3 January 31st 08 02:48 PM
Macro referencing multiple worksheets JULZ Excel Discussion (Misc queries) 1 October 9th 06 07:46 PM
Summary worksheet referencing multiple worksheets Jon Excel Worksheet Functions 1 January 27th 05 01:12 AM


All times are GMT +1. The time now is 11:23 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"