+ Reply to Thread
Results 1 to 10 of 10

Need a row moved to another WorkSheet if it has a date within last week

  1. #1
    Registered User
    Join Date
    04-11-2016
    Location
    Wales
    MS-Off Ver
    2007
    Posts
    8

    Need a row moved to another WorkSheet if it has a date within last week

    Hi everyone,

    I have been tasked with producing a weekly report of work done inside a spreadsheet. We would like a script that runs through the sheet, and copies every row that has a date in it from previous seven days, into another sheet.

    Please can you help me achieve this?

    Regards,

    Mikexcel

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Need a row moved to another WorkSheet if it has a date within last week

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    04-11-2016
    Location
    Wales
    MS-Off Ver
    2007
    Posts
    8

    Re: Need a row moved to another WorkSheet if it has a date within last week

    Firstly thank you for replying. I have attached a sample workbook, with any data desensitized. I just need a check in place to read the date fields, if it recognizes a date from within the past 7 days, then it is to copy that row into the "After" sheet.

    MTIA

    Mikexcel
    Attached Files Attached Files

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Need a row moved to another WorkSheet if it has a date within last week

    Which column(s) contain the date(s) you wish to check are within the last 7 days?

  5. #5
    Registered User
    Join Date
    04-11-2016
    Location
    Wales
    MS-Off Ver
    2007
    Posts
    8

    Re: Need a row moved to another WorkSheet if it has a date within last week

    That's just it, I need it to check all of the columns that have dates in.

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Need a row moved to another WorkSheet if it has a date within last week

    Ok. SO try something like:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-11-2016
    Location
    Wales
    MS-Off Ver
    2007
    Posts
    8

    Re: Need a row moved to another WorkSheet if it has a date within last week

    Excellent, thank you so much!

    Mikexcel

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Need a row moved to another WorkSheet if it has a date within last week

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. You can also 'Add Reputation' to users who helped you. Thanks.

  9. #9
    Registered User
    Join Date
    04-11-2016
    Location
    Wales
    MS-Off Ver
    2007
    Posts
    8

    Re: Need a row moved to another WorkSheet if it has a date within last week

    Just one more quick question, is it possible to put in a prompt to enter the date we would like to look 7 days back from?

    Thanks,

    Mike

  10. #10
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Need a row moved to another WorkSheet if it has a date within last week

    Something like this:
    Please Login or Register  to view this content.
    It's not clear whether you wanted to limit it to dates within that 7 day window (as the code above does), or whether you want ALL dates after 7 days before the manually entered date? If the second case is your requirement, then simply delete this bit:
    Please Login or Register  to view this content.

+ 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. Replies: 13
    Last Post: 10-10-2014, 06:50 AM
  2. [SOLVED] How to copy worksheet to new worksheet each week and rename the tabs for the monday date.
    By tmeakin! in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-04-2013, 01:17 PM
  3. Worksheet name moved to an Index page.
    By eber5266 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-18-2013, 10:58 PM
  4. [SOLVED] lookup a date according to week number from one worksheet and add it to another
    By sonor_nut in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-11-2013, 10:18 AM
  5. Replies: 11
    Last Post: 04-06-2011, 02:33 PM
  6. week start date and end date based on week number
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-02-2009, 12:39 PM
  7. Replies: 2
    Last Post: 07-13-2006, 09:50 PM

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