+ Reply to Thread
Results 1 to 6 of 6

FIll rows new sheet if row old sheet is chosen

  1. #1
    Registered User
    Join Date
    08-17-2016
    Location
    China
    MS-Off Ver
    2013
    Posts
    10

    FIll rows new sheet if row old sheet is chosen

    Hi guys,

    Hope you can help me out! I am trying to autofill a new sheet with rows of chosen rows in another sheet.

    For example, lets say you have 100 outlets in a list and you choose 40 of them (By filling a cell behind the row), i want those 40 to be displayed in a new sheet below one another without there being blank rows in between.

    Is anything like this possible?


    Kind regards,
    Martijn

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: FIll rows new sheet if row old sheet is chosen

    Hi, welcome to the forum

    See if this will get you started...
    A
    B
    C
    D
    E
    F
    G
    H
    1
    Header1 Header2 Header3 Select Header1 Header2 Header3
    2
    aa
    10
    50
    x aa
    10
    50
    3
    bb
    20
    100
    dd
    40
    200
    4
    cc
    30
    150
    cc
    70
    350
    5
    dd
    40
    200
    x aa
    90
    450
    6
    aa
    50
    250
    bb
    100
    500
    7
    bb
    60
    300
    dd
    120
    600
    8
    cc
    70
    350
    x
    9
    dd
    80
    400
    10
    aa
    90
    450
    x
    11
    bb
    100
    500
    x
    12
    cc
    110
    550
    13
    dd
    120
    600
    x

    F2=IFERROR(INDEX(A:A,SMALL(IF($D$2:$D$13="x",ROW($A$2:$A$13)),ROWS($A$1:A1))),"")
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Then copy down and across as needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    08-17-2016
    Location
    China
    MS-Off Ver
    2013
    Posts
    10

    Re: FIll rows new sheet if row old sheet is chosen

    It works as a charm!

    However i had an additional question. Since i want the rows to appear on a new sheet, i used an indirect formula to link cell A:A to the sheet name where i pull the data from (Have to copy the same formula over multiple sheets later on). However, when i use a Indirect formula, i can't drag the formula to the right or down because the cell is locked. Would you have any idea how to bypass this with an indirect formula? The formula now looks the following:

    {=IFERROR(INDEX(INDIRECT("'"&A2&"'!"&"A:A"),SMALL(IF(INDIRECT("'"&A2&"'!"&"$S$2:$S$100000")="X",ROW(INDIRECT("'"&A2&"'!"&"$A$2:$A$100000"))),ROWS(INDIRECT("'"&A2&"'!"&"$A$1:A1")))),"")}

    Help would be much appreciated!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: FIll rows new sheet if row old sheet is chosen

    Have you tried adding a 2nd match to the formula to ID the heading?

    Based on my sample abobe, something like...
    F2=IFERROR(INDEX($A:$C,SMALL(IF($D$2:$D$13="x",ROW($A$2:$A$13)),ROWS($A$1:A1)),match(F$1,$A$1:$C$1,0)),"")

    If you still have a problem,

    upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

  5. #5
    Registered User
    Join Date
    08-17-2016
    Location
    China
    MS-Off Ver
    2013
    Posts
    10

    Re: FIll rows new sheet if row old sheet is chosen

    Alright made a very simple table without formulas. Basically i want to make your table from F but then put that data into a new sheet using indirect. Or maybe you know another easy formula to do that with. Any help is appreciated !
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-17-2016
    Location
    China
    MS-Off Ver
    2013
    Posts
    10

    Re: FIll rows new sheet if row old sheet is chosen

    I came up with something like:

    =IFERROR(INDEX(INDIRECT("'"&A2&"'!"&CELL("address",A:A)),SMALL(IF(INDIRECT("'"&A2&"'!"&CELL("address",$S$2:$S$13))="X",ROW(INDIRECT("'"&A2&"'!"&CELL("address",$B$2:$B$13)))),ROWS(INDIRECT("'"&A2&"'!"&CELL("address",A$1:$B1))))),"")

    But doesn't seem to work the way i want it yet!

+ 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. Move rows to another sheet when value is chosen from a drop-down menu in cell
    By Oweineh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-25-2013, 10:01 AM
  2. Moving Rows to another Sheet chosen from a drop down list
    By RumaR28 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-25-2013, 07:32 AM
  3. Replies: 0
    Last Post: 05-01-2013, 01:19 PM
  4. look up on sheet 1 match data sheet 2 and fill in cell on first sheet
    By treborharris in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-28-2013, 01:01 PM
  5. [SOLVED] Move rows to another sheet when value is chosen from a drop-down menu in cell
    By tanimytani in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-07-2012, 07:50 AM
  6. Replies: 1
    Last Post: 07-30-2012, 02:35 PM
  7. macro for transfering chosen rows to new sheet
    By puebla in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-10-2011, 04:28 PM
  8. Replies: 2
    Last Post: 10-15-2009, 10:12 AM

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