Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select all sheets vba (XP)

    Hi

    I recorded a macro to select all sheets, but it used the Array(1,2,3,4,) method with the sheet names.

    I want to be able to select all sheets, but use the module in various workbooks, ie with varying amounts of sheets.

    Can I do something like

    p = Sheets.Count
    v = Array(1, 2, -to p) ' how can i enumerate this?
    Sheets(v).Select

    or is there a nice simply way?
    Thanks,

    pmatz

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Select all sheets vba (XP)

    <code>ActiveWorkbook.Sheets.Select</code> <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select all sheets vba (XP)

    i am dumb!!!

    cheers rory
    Thanks,

    pmatz

Posting Permissions

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