+ Reply to Thread
Results 1 to 4 of 4

If Cell = peaches, Then Copy Entire Row Into A New Sheet

  1. #1
    Registered User
    Join Date
    05-31-2016
    Location
    Amsterdam
    MS-Off Ver
    2013
    Posts
    2

    Question If Cell = peaches, Then Copy Entire Row Into A New Sheet

    Hello,

    I am new here and for my daily work I need to copy data from one worksheet to another.
    Till now I am using the filter option and copy everything manually, but as it takes some time I would like to automate this.

    I already found this tread and modified it a bit to something that looks like my own datasheet, but I figured out that in this VBA code only limited data is copied. If I start of with "peaches" only, row A / C / E / G / I / K are copied to Sheet1...

    Can someone help me with that? And is it also possible that - when re entering the "Command Button", first all data of Sheet 1/ Sheet 2/ Sheet 3 is removed and then copied? This in order to not have doubles listed.

    Thanks for you help in advance!

    Kind regards,
    Eva

    PS: See here the worksheet

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: If Cell = peaches, Then Copy Entire Row Into A New Sheet

    If I'm understanding your needs correctly, you don't need VBA for this. Put the formula below in A2 of "sheet1". Confirm it with Ctrl + Shift + Enter instead of the regular Enter. Then, fill right through column D, then fill down through as many rows as you think you'll need for "peaches".

    =IFERROR(INDEX(Input!A$2:A$100,SMALL(IF(Input!$B$2:$B$100="peaches",ROW(Input!$B$2:$B$100)),ROW(1:1))-1),"")

    This formula covers 99 entries. If you think you'll need more, change the "100"s in the formula to something bigger. You can do the same with sheets 2 and 3, just change the part of the formula that says "peaches" to whatever you're filtering for on that sheet. If you fill down through empty rows, the sheets should update automatically as you add new entries into "Input".

    See attachment for clarity...
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: If Cell = peaches, Then Copy Entire Row Into A New Sheet

    Of met een macro.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-31-2016
    Location
    Amsterdam
    MS-Off Ver
    2013
    Posts
    2

    Re: If Cell = peaches, Then Copy Entire Row Into A New Sheet

    Thank you guys very much! Actually I like the formula the most as I do understand that the best myself .
    However, my sheet is a bit slow now, I can easily adjust it myself.

    Thanks for you help!!

+ 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. If a cell value = yes copy the entire row into a new sheet
    By apatel25 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2014, 10:47 AM
  2. if cell is=z copy entire row to another sheet
    By tsioumiou in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-04-2014, 09:46 AM
  3. [SOLVED] If Cell = X Copy Entire row to another sheet
    By Misbah211 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 08-06-2012, 10:05 AM
  4. Copy entire row to a new sheet when cell value is less than 100
    By Dame in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-05-2012, 08:47 AM
  5. Copy entire sheet, and name it according to a cell
    By gnoke in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-04-2010, 02:53 AM
  6. If Cell = X, Then Copy Entire Row Into A New Sheet-Help
    By AmandaBorthwick in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-26-2009, 12:22 AM
  7. If Cell = X, Then Copy Entire Row Into A New Sheet
    By McNulty in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-04-2009, 11:50 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