+ Reply to Thread
Results 1 to 4 of 4

Using a macro how do I group every sheet within a book?

  1. #1
    Pank Mehta
    Guest

    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. #2
    Bob Phillips
    Guest

    Re: Using a macro how do I group every sheet within a book?

    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" <Pank@discussions.microsoft.com> wrote in message
    news:B5B86D20-22B8-43BC-A8B7-826FCCF1B063@microsoft.com...
    > 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. #3
    Pank Mehta
    Guest

    Re: Using a macro how do I group every sheet within a book?

    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" <Pank@discussions.microsoft.com> wrote in message
    > news:B5B86D20-22B8-43BC-A8B7-826FCCF1B063@microsoft.com...
    > > 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. #4
    Dave Peterson
    Guest

    Re: Using a macro how do I group every sheet within a book?

    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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1