Archive of Mr Excel Message Board
Back to Excel VBA archive index
Back to archive home
Do same thing to all sheets in workbookPosted by Zif on February 20, 2001 8:50 AM
I'm sure this is fairly simple for you guys and gals with such talent!!
I need to perform the same action to every sheet in a workbook. The number of sheets in the workbook varies from week to week (usually between 20 and 40 sheets).
What I need to do is (for example) put the text "Checked" into cell A7 on every sheet.
|Check out our Excel VBA Resources
same thing to all sheets - use Across WorksheetsPosted by Loren on February 20, 2001 9:10 AM
Re: Do same thing to all sheets in workbookPosted by Aladin Akyurek on February 20, 2001 9:16 AM
One way to do it:
Left lick on the tab of the first sheet, press and hold shift key, go to the tab of the last sheet and give a left click again. Then go to cell A7 on the first sheet and type "Checked". Deactivate the selected sheets by reclicking on a tab of one the selected sheets.
ClarificationPosted by Zif on February 20, 2001 2:39 PM
SHould have pointed out that I really need to do this using VBA - worksheets are protected, so I need to unprotect each in turn, make change, reprotect (with password).
I can't do that if I select multiple sheets.
Re: ClarificationPosted by Celia on February 20, 2001 4:55 PM
Dim ws As Worksheet
For Each ws In Worksheets
.Range("A7") = "Checked"
PS. Don't forget to protect your modulePosted by Celia on February 20, 2001 4:57 PM
This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store
to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.