+ Reply to Thread
Results 1 to 8 of 8

Search for values, copy matching rows to existing sheet in a specific place?

  1. #1
    Registered User
    Join Date
    05-12-2016
    Location
    Mountain West
    MS-Off Ver
    Mac 2016
    Posts
    5

    Question Search for values, copy matching rows to existing sheet in a specific place?

    Hi all,

    I have a workbook where I have information categorized in several sheets.
    Lets say they're named Red, Blue, Green, Yellow.

    In each sheet I have a row that has data identified by date.
    For example, Red Sheet has this data:
    5/12/16 X-wing
    2/12/16 TIE Fighter
    4/12/16 Y-wing
    1/12/16 Star Destroyer
    2/11/16 Mon Calamari Cruiser

    Now, the first sheet in the workbook is named Calendar.
    It is organized like this:

    Jan Days | January
    Week 1 | (blank row)
    Week 2 | (blank row)
    Week 3 | (blank row)
    Week 4 | (blank row)

    Feb Days | February
    Week 1 | (blank row)
    Week 2 | (blank row)
    Week 3 | (blank row)
    Week 4 | (blank row)

    (and so forth) The Days/Weeks are actually rows/columns that make up a mini calendar w/the days/dates. I want to automatically copy from each sheet (Red, Blue, Green & Yellow) the data row with a date into the Calendar sheet under the appropriate month in date order.
    For example:

    Jan Days | January
    Week 1 | 1/12/16 Star Destroyer
    Week 2 | (blank row)
    Week 3 | (blank row)
    Week 4 | (blank row)

    Feb Days | February
    Week 1 | 2/11/16 Mon Calamari Cruiser
    Week 2 | 2/12/16 TIE Fighter
    Week 3 | (blank row)
    Week 4 | (blank row)

    I've played with VLOOKUP, INDEX, IF's, MONTH, and some VBA code. I'm not getting it to work, so wonder if one of you can possibly help me out?

    Sample spreadsheet here via Dropbox
    I'd be fine with a button on 'January' that I'd have to click to run the function.

    Many thanks in advance!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,705

    Re: Search for values, copy matching rows to existing sheet in a specific place?

    What do you want to see if you have two or more events in the same week?

    Pete

  3. #3
    Registered User
    Join Date
    05-12-2016
    Location
    Mountain West
    MS-Off Ver
    Mac 2016
    Posts
    5

    Re: Search for values, copy matching rows to existing sheet in a specific place?

    Hey Pete,

    Can you take a look at the sample workbook? It'll be easier to understand. The event rows aren't mapped to the calendar rows - it's hard to show it via text. Hopefully this screenshot will help.

    Test_Workbook_Copy_and_Paste.jpg

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,705

    Re: Search for values, copy matching rows to existing sheet in a specific place?

    I had already downloaded your file, but your opening description implied that each blank row was for a particular week.

    Follow-up question, in the light of your comments: you have 9 blank rows for each month - what would you like to happen if you have more than 9 events in any one month?

    Pete

  5. #5
    Registered User
    Join Date
    05-12-2016
    Location
    Mountain West
    MS-Off Ver
    Mac 2016
    Posts
    5

    Re: Search for values, copy matching rows to existing sheet in a specific place?

    Pete,

    If there are more than 9 events, I'd like the additional events inserted above the following month, maintaining a buffer of one empty row between the Jan events and the Feb header.

    Thanks!

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,705

    Re: Search for values, copy matching rows to existing sheet in a specific place?

    A formula can't insert a row for you - you would need VBA for that then, and I don't dabble with macros anymore, so perhaps someone else will chip in.

    Pete

  7. #7
    Registered User
    Join Date
    05-12-2016
    Location
    Mountain West
    MS-Off Ver
    Mac 2016
    Posts
    5

    Re: Search for values, copy matching rows to existing sheet in a specific place?

    Thanks for the clarification re: needing VBA to insert rows. Appreciate your time!

  8. #8
    Registered User
    Join Date
    05-12-2016
    Location
    Mountain West
    MS-Off Ver
    Mac 2016
    Posts
    5

    Re: Search for values, copy matching rows to existing sheet in a specific place?

    Quote Originally Posted by Pete_UK View Post
    A formula can't insert a row for you - you would need VBA for that then, and I don't dabble with macros anymore, so perhaps someone else will chip in.

    Pete
    Pete, should I request a mod to move this post over to the VBA forum then?

    Thanks!

+ 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. Search for a value in a column and copy row to new sheet for all matching values
    By gopi2417 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-02-2017, 09:11 AM
  2. [SOLVED] Searching Values that Follow a Specific Format and Copy Rows to a New Sheet
    By aviatecar in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-18-2014, 07:11 AM
  3. Replies: 3
    Last Post: 03-31-2014, 01:00 PM
  4. [SOLVED] Search values and copy to specific sheet & cells
    By keis386 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-19-2013, 12:24 PM
  5. Search a Column for a specific Value and Place in Another sheet
    By basketball2524 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-19-2013, 10:19 PM
  6. Copy rows with values in specific column to first empty row in specified sheet
    By scaffdog845 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2013, 08:29 PM
  7. [SOLVED] Search for a value in a column and copy row to new sheet for all matching values
    By mrcois in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2012, 12:09 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