Dates: Selecting rows based on 2 week intervals

  • Hello need help setting up a macro which will look 2 weeks forward down a column and select the data between the activecell and 2 weeks ahead.


    The catch is the date 2 weeks ahead cannot be on a weekend, if it is then the macro should go back 1 day, and go back another day until it find a date. Once this 2 week interval is selected the macro should copy the info, and paste it in a new sheet. PLEASE HELP ME WITH THIS CODE

  • Re: Dates: Selecting rows based on 2 week intervals


    LET ME CLARIFY:
    I have data from a calendar in my excel spreadsheet, I want to be able to select any date located in the first Column A, and then run a macro which will find the date 2 weeks ahead, copy the data in between and paste in a new sheet or new file.


    The problem is the date 2 weeks ahead must be a weekday, becasue weekend and holiday info is missing. If the date 14 days ahead is missing I want the macro to go to the previous day and try to find it, if it is also missing then go back 1 more day...until it find a date which is actually in the calendar data.


    Thanks for the help, i appreciate it!

  • Re: Dates: Selecting rows based on 2 week intervals


    Column A contains all the dates, the other 4 columns contain info, anmd I am looking to select and copy 2 weeks (14 days) forward from the activecell selected, any date that is selected when the macro is started.

  • Re: Dates: Selecting rows based on 2 week intervals


    I have attached a workbook which contains data which is similar to the data I will be working with later.


    As can be seen Column A conatins all the dates, What i want to do is select any cell in Column A and be able to copy all the rows down from the Selected Date to 2 weeks forward (14 days ahead). I want to copy all the data in between and paste it into a new sheet.


    I want to copy from Start Date to End date, 14 day period. Whatever cell I click on I want the macro to copy all the data between Start and End. Sometimes End date wont be in the data, there are gaps for weekend and holidays then I want the macro to check End Date -1, go back one day and check, if there is still no date go back another day until a end date can be set. Then Copy from Start Date to end Date and past in a new sheet.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!