+ Reply to Thread
Results 1 to 3 of 3

Copy a range of cells to different sheet depending on which month

  1. #1
    Registered User
    Join Date
    03-23-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2016
    Posts
    2

    Copy a range of cells to different sheet depending on which month

    So I've searched the internet for many hours but i just cannot find a way to do this. I'm not that advanced with excel and with corona i'm getting extra tasks but i lack knowledge for this one.
    I'm not even sure if it needs a macro or just formulas so i'm sorry if this is the wrong thread.
    So the intention is that depending on the month the work schedule of the employees gets copied to sheet 2.


    Either fully automatic, if excel can detect what month it is, it copies the range of cells to sheet 2. But I was thinking that this will be repeating itself every time you open the file and the file in which this needs to happen is pretty big and full of makros already.
    Or if you typ the month in a certain cell in sheet 2 and it will go compare/look it up in sheet 1 so it will know which range of cells to copy.

    The range of cells to copy is always equally big, just more rows down.

    I hope you can understand what i mean
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,848

    Re: Copy a range of cells to different sheet depending on which month

    Here is one possibility for a formula based approach:
    1. List the months in a column (AN in the attached file)
    2. Populate another column (AI in the attached file) using: =IF(COUNTIFS(AN$2:AN$13,A2),A2,AI1)
    On Sheet2 cell B2 has a data validation drop down applied and cells A3:AG13 are populated using:
    =INDEX(Sheet1!A$2:A$26,AGGREGATE(15,6,(ROW(Sheet1!$A$2:$A$26)-ROW(Sheet1!$A$1))/(Sheet1!$AI$2:$AI$26=$A$2)/(Sheet1!$A$2:$A$26<>$A$2),ROWS($A$1:$A1)))
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Copy a range of cells to different sheet depending on which month

    Can you explain a little more how you currently handle this process?

    If its just a matter of looking at a worksheet and determining the month to copy based on a column, then it can be done with a macro.

    Example.

    Your master list has 300 rows.
    Column B is your date value

    The macro can be run manually or automatically to take todays date(determine the month) and then go look in Column B for any dates that fall in the month.

    Select rows that match and copy and paste as needed.

    This can be done. Just need little more context on your source data and how you expect to identify the rows you want to work with.

+ 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 Range from One sheet to Another , depending upon record match.....Not working...
    By enggrahul78 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-06-2019, 06:54 AM
  2. [SOLVED] Copy and paste range of cells depending on another cell
    By JT100392 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-15-2019, 06:19 AM
  3. [SOLVED] Copy range to other sheet depending on entry in cell
    By RutgerdV in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-17-2016, 06:11 AM
  4. VBA code to copy data to another sheet depending on the month
    By kanyarat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-25-2015, 03:46 PM
  5. Check cell value in range, depending on condition copy to another Sheet
    By KemalO in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2015, 11:01 AM
  6. [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
  7. 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

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