+ Reply to Thread
Results 1 to 5 of 5

Reduce this macro

  1. #1
    Registered User
    Join Date
    07-24-2009
    Location
    Constanta
    MS-Off Ver
    Excel 2010
    Posts
    62

    Reduce this macro

    Hello,
    How can I make this macro easier (smaller)? The same action is performed on an array of sheets (not all sheets).

    Please Login or Register  to view this content.
    Last edited by magicool; 02-03-2010 at 11:24 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Reduce this macro

    Perhaps:

    Please Login or Register  to view this content.

    (if the sheet names are all numeric and sequential you could just use a numeric loop rather than a Sheets Array)

  3. #3
    Registered User
    Join Date
    07-24-2009
    Location
    Constanta
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Reduce this macro

    Thank you! It is perfect.
    The sheet names are all numeric and sequential. How to use a numeric loop? Also is it possible to use that on a range of sequential sheets (regardless their names)?

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Reduce this macro

    If we assume the sheet names are sequential and numeric then:

    Please Login or Register  to view this content.
    If the names were themselves not numeric but the sheets were in sequence physically in the file (eg first 9 sheets) then you can use the number as the Index position - ie remove the ""& from the With statement.

  5. #5
    Registered User
    Join Date
    07-24-2009
    Location
    Constanta
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Reduce this macro

    Thank you! This is very fast!

+ 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