Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Using a macro how do I group every sheet within a book?
Using a macro how do I group every sheet within a book?
I have created a macro, but find that the names of the sheets will differ every time and hence I need a mechanism that will automatically select all of them to allow me to undertake editing within them all at the same time. |
#2
|
|||
|
|||
Dim arySheets
Dim sh Dim i As Long ReDim arySheets(ActiveWorkbook.Worksheets.Count - 1) For Each sh In ActiveWorkbook.Worksheets arySheets(i) = sh.Name i = i + 1 Next sh Sheets(arySheets).Select -- HTH RP (remove nothere from the email address if mailing direct) "Pank Mehta" wrote in message ... Using a macro how do I group every sheet within a book? I have created a macro, but find that the names of the sheets will differ every time and hence I need a mechanism that will automatically select all of them to allow me to undertake editing within them all at the same time. |
#3
|
|||
|
|||
Bob,
Many thanks "Bob Phillips" wrote: Dim arySheets Dim sh Dim i As Long ReDim arySheets(ActiveWorkbook.Worksheets.Count - 1) For Each sh In ActiveWorkbook.Worksheets arySheets(i) = sh.Name i = i + 1 Next sh Sheets(arySheets).Select -- HTH RP (remove nothere from the email address if mailing direct) "Pank Mehta" wrote in message ... Using a macro how do I group every sheet within a book? I have created a macro, but find that the names of the sheets will differ every time and hence I need a mechanism that will automatically select all of them to allow me to undertake editing within them all at the same time. |
#4
|
|||
|
|||
Another way:
Sheets.Select or worksheets.select (if you want to avoid selecting non-worksheets (like Chart sheets).) Pank Mehta wrote: Using a macro how do I group every sheet within a book? I have created a macro, but find that the names of the sheets will differ every time and hence I need a mechanism that will automatically select all of them to allow me to undertake editing within them all at the same time. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do i enable "Group" & "Ungroup" in a protected sheet | Excel Discussion (Misc queries) | |||
Can a macro format a hidden sheet? | Excel Discussion (Misc queries) | |||
Subtotal of Subtotal displays Grand Total in wrong row | Excel Worksheet Functions | |||
2 questions, copying data from sheet to sheet and assigning macro | Excel Worksheet Functions | |||
Macro, select Sheet "Number", NOT Sheet Name | Excel Worksheet Functions |