+ Reply to Thread
Results 1 to 2 of 2

Refer to a range of worksheets in macro

  1. #1
    Registered User
    Join Date
    02-11-2006
    Posts
    23

    Refer to a range of worksheets in macro

    I am trying to run a script but would like to refer to a range of worksheets.

    'loop through all worksheets and copy the data to the DestSh
    For Each sh In ActiveWorkbook.Sheets(Array("1", "2"))

    Now I have a lot of worksheets that are ordered consecutively (e.g. 1-40) and I don't want to put all of the names into the array. Any easy way to do this?
    Thanks!!!!

  2. #2
    Valued Forum Contributor
    Join Date
    10-15-2007
    Location
    Home
    MS-Off Ver
    Office 2010, W10
    Posts
    373

    Re: Refer to a range of worksheets in macro

    Hi svenk

    If they are ordered consecutively, you can use their index.

    Ex:

    Please Login or Register  to view this content.

+ 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