+ Reply to Thread
Results 1 to 7 of 7

Loop codes through multiple sheets (not all sheets in workbook)

  1. #1
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    Loop codes through multiple sheets (not all sheets in workbook)

    Hi all, good day!

    I have a workbook with sheets named from 1 to 30. Apart from that, there's few other sheets as well which are not numbers.

    I would like to copy range E2:E341 from sheets 1 to 30 to one of my sheet named "temp" on column B and to the next blank row.

    I tried to develop the code but am not sure how to loop thru the sheets from 1 to 30.

    Below is the not working codes that i've tried.

    Please Login or Register  to view this content.
    Appreciate any assistance.

    Thank you!

  2. #2
    Registered User
    Join Date
    02-13-2013
    Location
    Bergen County
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Loop codes through multiple sheets (not all sheets in workbook)

    Hi hcyeap,

    Try this code...let me know how it works out for you.

    Please Login or Register  to view this content.
    Thanks,
    Fonzie
    Satisfied? Click the * below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    Re: Loop codes through multiple sheets (not all sheets in workbook)

    Hi fonzie29,

    Thank you for your reply!

    I am afriad this code is not working because other than the "temp" sheet, i have few other sheets which should be excluded as well.
    If the code 1 to 30 can't work, the only way would be the exclusion of all the other sheets?

    Thanks.

  4. #4
    Registered User
    Join Date
    02-13-2013
    Location
    Bergen County
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Loop codes through multiple sheets (not all sheets in workbook)

    How many other sheets to you have to exclude?

    thanks.

  5. #5
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    Re: Loop codes through multiple sheets (not all sheets in workbook)

    for now would be only three sheets.
    However, i am not sure whether there will be additional sheets to be excluded.
    The sheets named 1 to 30 are fixed, that is why I thought of using that to make it more future proof.

    Thanks!

  6. #6
    Registered User
    Join Date
    02-13-2013
    Location
    Bergen County
    MS-Off Ver
    Excel 2010
    Posts
    36

    Cool Re: Loop codes through multiple sheets (not all sheets in workbook)

    Gotcha! Try this code then...

    Please Login or Register  to view this content.
    Thanks,
    Fonzie
    Last edited by fonzie29; 03-18-2014 at 12:56 AM. Reason: didn't need this line of code "Sheets(sheetName).Select"

  7. #7
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    Re: Loop codes through multiple sheets (not all sheets in workbook)

    Hi Fonzie,

    Thanks for the prompyt reply.
    And yupe, it's working smoothly and the result is what I intended.

    Thank you very much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to copy cells from multiple sheets in workbook to multiple sheets in other workbook
    By KeithMale in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-13-2013, 05:37 PM
  2. [SOLVED] loop action through all sheets in workbook skipping certain sheets
    By sawa85sa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-10-2013, 06:40 PM
  3. [SOLVED] Highlighting the same cell in one workbook with multiple sheets with various sheets names.
    By DanielRay in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2013, 01:50 PM
  4. vlookup codes - multiple sheets
    By intothewild in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-27-2012, 05:40 PM
  5. Replies: 4
    Last Post: 08-17-2006, 01:30 AM

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