+ Reply to Thread
Results 1 to 3 of 3

Need to loop code for certain worksheets in workbook

  1. #1
    Forum Contributor
    Join Date
    06-13-2009
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    245

    Smile Need to loop code for certain worksheets in workbook

    Hello, could some one please help me with the following:

    I know I have posted this problem before, but after doing more research I think I discovered why I could never get any code to work properly. The problem was with how Excel treats dates.

    I have managed to put together part of an Excel 2003 macro that does the following:

    I have tested the following code and it does filter my data properly.

    Please Login or Register  to view this content.

    It asks the user for the DateFrom and DateTo

    With this input, it filters worksheet named: Z-1 in column AN

    It then filters in the same worksheet column AQ for any cells with the value of: VACANT

    As an example, I entered the date value of: 27-May-10 for DateFrom
    I entered the date value of: 26-Jun-10 for DateTo

    What I need it to do is the following:

    I need the results of the filtered data to be copied to worksheet named: 1 Mth at cell A3

    I then need a loop to repeat the same procedure for the remaining worksheets that have the letter "Z" in their name.

    That is worksheets named: Z-1, Z-2, Z-3, Z-4, Z-5, Z-7, Z-9, Z-10, Z-11, Z-12, Z-15, Z-17, Z-18, Z-19 AND Z-20.

    I have attached my workbook with "dummy-data".

    If some one could please help me, it would be greatly appreciated.

    Kind regards,

    Chris
    Attached Files Attached Files
    Last edited by longbow007; 05-28-2010 at 08:02 AM.

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Need to loop code for certain worksheets in workbook

    See attached file.
    This is the macro I used:
    Please Login or Register  to view this content.
    Regards,
    Antonio
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    06-13-2009
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    245

    Re: Need to loop code for certain worksheets in workbook

    Thanks very much antoka05 for your kind assistance and help - muchly appreciated. Your code works very well

+ 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