Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Pank Mehta
 
Posts: n/a
Default 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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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   Report Post  
Pank Mehta
 
Posts: n/a
Default

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   Report Post  
Dave Peterson
 
Posts: n/a
Default

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
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
How do i enable "Group" & "Ungroup" in a protected sheet Fadi Excel Discussion (Misc queries) 1 March 4th 05 05:37 PM
Can a macro format a hidden sheet? Robert Excel Discussion (Misc queries) 1 February 9th 05 06:13 PM
Subtotal of Subtotal displays Grand Total in wrong row Thomas Born Excel Worksheet Functions 5 January 6th 05 01:46 PM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 06:11 PM
Macro, select Sheet "Number", NOT Sheet Name DAA Excel Worksheet Functions 4 November 30th 04 05:29 PM


All times are GMT +1. The time now is 10:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"