+ Reply to Thread
Results 1 to 4 of 4

Copy cells from another sheet depending on date

  1. #1
    Registered User
    Join Date
    11-12-2017
    Location
    Stafford, England
    MS-Off Ver
    365
    Posts
    184

    Copy cells from another sheet depending on date

    Hi,

    Not sure this can be done with formulas but it will be a shared file so can't use VBA
    Excuse the design, this has been stripped for sharing purposes

    Sheet 1 is a sample of a working worksheet, the Week Number in cells C4,P4,C25,P25 are formulas based on date in cells D5,Q5,D26,Q26 so will update week on week
    The date in D5 looks at today's date and returns the Monday of that week, and all other dates are D5+1,2,3... etc so the 4 weeks will always show Monday to Sunday
    The month in rows 4 & 25 pull from the date in rows 5 & 26
    All this works fine and will constantly show a rolling 4 weeks from the Monday of the current week.

    Sheet 2 is a new sheet where I will collate data on a weekly basis, there are no formulas for week numbers or dates as this sheet will include an entire year.
    In this sample there are only 6 weeks to see if what I'm looking for can be achieved.
    For each Line 1, Line 2, Line 3... etc, Monday to Sunday, there is an in-cell dropdown list Yes,No,Maybe (data validation is for sample, this will change)
    User inputs data on Sheet 2 for specific "Line" Monday-Sunday

    What I'm looking to achieve is the data from Sheet 2 copied to Sheet 1 but matching the week number, then I would have an auto populated rolling 4 weeks.
    This would mean I need formulas on Sheet 1 D6:J22; Q6:W22; D27:J43; Q27:W43 to reference Sheet 2 of the corresponding week.
    I'm just not sure this can be done with formulas as what is currently Week 22 next week becomes Week 23 and so on.
    Sheet 2 D7:J23 to Sheet 1 D6:J22
    Sheet 2 L7:R23 to Sheet 1 Q6:W22
    Sheet 2 T7:Z23 to Sheet 1 D27:J43
    Sheet 2 AB7:AH23 to Sheet 1 Q27:W43

    I could possibly use a non shared workbook that collates data from sheet 2, uses VBA to achieve what I want and then sheet 1 pulls from that unshared workbook. Formulas on Sheet 1 would be easier though.

    Any help greatly appreciated
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    06-23-2021
    Location
    Romania
    MS-Off Ver
    2021, 365 v 2208
    Posts
    722

    Re: Copy cells from another sheet depending on date

    Hi,
    maybe something like:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Diana Tanase


    If the solutions offered helped you to solve your problem, then mark the thread as SOLVED (thread tools in the top menu) and you can click on * to add reputation to those who helped you, as a way to say thank you !

  3. #3
    Registered User
    Join Date
    11-12-2017
    Location
    Stafford, England
    MS-Off Ver
    365
    Posts
    184

    Re: Copy cells from another sheet depending on date

    Oh wow, yes!

    It looks to be just what I am after, I'll roll it out to the actual workbook and then I can manually change the date in D5 to check it works fine week on week.

    I assume I just change the reference to AX to the last cell in range when I expand my data for the entire year?
    =LET(a,INDEX(Sheet2!$D$6:$AX$23,MATCH($C6,Sheet2!$C$6:$C$23,0),MATCH(Sheet1!D$5,Sheet2!$D$6:$AX$6,0)),IF(a=0,"",a))

    I wasn't expecting a reply so quickly
    Thank you so much

  4. #4
    Valued Forum Contributor
    Join Date
    06-23-2021
    Location
    Romania
    MS-Off Ver
    2021, 365 v 2208
    Posts
    722

    Re: Copy cells from another sheet depending on date

    You're welcome!
    If the solutions offered helped you to solve your problem, then mark the thread as SOLVED (thread tools in the top menu) and you can click on * to add reputation to those who helped you, as a way to say thank you !

+ 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. Copy a range of cells to different sheet depending on which month
    By Steffidc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2021, 06:00 PM
  2. Copy cells into specific rows depending on value (Date) in column A
    By lewiem in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-06-2016, 09:45 AM
  3. Macro to copy & paste data into new sheet depending on column header (date)?
    By BobbyH89 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-20-2015, 03:44 PM
  4. [SOLVED] Copy cells from each row into new sheet, depending on if statement
    By christopherL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-28-2013, 08:06 AM
  5. Copy cells from another sheet depending on category
    By Lemac in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-14-2013, 06:47 PM
  6. VBA Macro to copy cells to another sheet based on the date value
    By lilis_hlias in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2012, 04:57 AM
  7. copy row depending on value to new sheet
    By jonpdavies@gmail.com in forum Excel General
    Replies: 5
    Last Post: 09-28-2005, 01:05 PM

Tags for this Thread

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