+ Reply to Thread
Results 1 to 3 of 3

Help with Macro looping

  1. #1
    Registered User
    Join Date
    04-21-2009
    Location
    Nottingham
    MS-Off Ver
    Excel 2003
    Posts
    66

    Help with Macro looping

    Hi all, I have attached an example file to help understand my requirements.

    What I need is a looping macro. The macro will use the date as the focal point. I need the data in columns D:G copied, and pasted into another sheet in an order by date.

    So the macro will select however many rows there are determined by date.

    To start with it will select D1:G1, copy the data and paste into D2:G2 in sheet 2 (for example), it will then go back to sheet 1, and select by next date the next lot of data - D2:G7 (as those rows all have the same date) and will paste into sheet 2 directly below the existing data - so in D3:G3, the macro will then return to sheet 1 and repeat this process until all the data has been copied and pasted and it will then stop.

    Please can someone help how this can be done. It is important that the macro does this process by date order.
    Attached Files Attached Files

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Help with Macro looping

    Did you consider sorting the data by date ?

  3. #3
    Registered User
    Join Date
    04-21-2009
    Location
    Nottingham
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: Help with Macro looping

    It is sorted by date, but I need the macro to copy the data by date and then paste into the other sheet (Sheet2 in the example) as this triggers anotehr macro in my actual data sheet, before going abck to sheet 1 and copying the next range of data.

    I basically need a maco that can differentiate between dates, and move onto the next set of data each time until all data has been copied

+ 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