+ Reply to Thread
Results 1 to 7 of 7

Way to filter out Unused space and Copy/paste onto another worksheet

  1. #1
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Way to filter out Unused space and Copy/paste onto another worksheet

    I have one Tab (Daily Chgs) that as of this moment has a defined set of spaces under certain breakdowns in column 'B' - what I would like is to have the unused space to go away when it populates the Job Ticket Tab

    Because we are going to add additional lines under each subset that may or may not be used.....

    I only have a set number of spaces on the Destination sheet so i can not keep unused portions I only have room for the Used sections to the Job Ticket Tab Starting in row 10.

    Example: I will have 15 drop downs under each subset to choose from, you may only use a couple so I want to be able to only grab the completed parts and paste to the other sheet.

    You can see when it fills out right now I would like to be able and have the unused space to go away when it populates the Job Ticket Tab.

    I am not sure that I am explaining it OK but Can this be done?

    I know right now there are formulas in certain cells I will make those changes Once this portion changes.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Way to filter out Unused space and Copy/paste onto another worksheet

    I'd use INDEX(SMALL instead to only fill with data that isn't blank.

    Unmerge A10:E52.

    A10:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Confirm this formula with Ctrl+Shift+Enter

    Now merge A10:E10, and copy that cell down to A52.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to filter out Unused space and Copy/paste onto another worksheet

    Well everything was working great ...then we modified the daily chgs sheet to include more rows starting with the first category and we are going to do the same for the others just in case you need other rows to add other charges but now I tested it and your formula to bring in the rows with information is not populating but I cant figure out why.
    Attached Files Attached Files

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Way to filter out Unused space and Copy/paste onto another worksheet

    You adjusted the referenced range, but not the row outputs.

    The ROW(range) or COLUMN(range) has to equal the number of rows or columns in the range you're indexing.

    So if you INDEX(a21:a50,.... you also need the ROW(a1:a30). The index is 30 rows, you need 30 rows to output.

    =IFERROR(INDEX('Daily Chgs'!$B$3:$B$55,SMALL(IF('Daily Chgs'!$B$3:$B$55<>"",ROW($A$1:$A$43)),ROW(A1))),"")

    So since the INDEX has changed to b3:b55 (53 rows) you need to adjust the output to 53.

    =IFERROR(INDEX('Daily Chgs'!$B$3:$B$55,SMALL(IF('Daily Chgs'!$B$3:$B$55<>"",ROW($A$1:$A$53)),ROW(A1))),"")
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to filter out Unused space and Copy/paste onto another worksheet

    Thank you I added
    Please Login or Register  to view this content.
    So it would automatically change ....Did i Do this correct?

    I added 'Daily Chgs'! to the Output

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Way to filter out Unused space and Copy/paste onto another worksheet

    That is correct!

  7. #7
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Way to filter out Unused space and Copy/paste onto another worksheet

    Here's the logical breakdown, (starting with the 3rd row) in case you're interested:

    =INDEX('Daily Chgs'!$B$3:$B$59,SMALL(IF('Daily Chgs'!$B$3:$B$59<>"",ROW('Daily Chgs'!$A$1:$A$57)),ROW(A3)))

    The nested expression evaluates to True and False:

    =INDEX('Daily Chgs'!$B$3:$B$59,SMALL(IF({TRUE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;TRUE;TRUE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;TRUE;TRUE},ROW('Daily Chgs'!$A$1:$A$57)),ROW(A3)))

    The ROW expression evaluates next:

    =INDEX('Daily Chgs'!$B$3:$B$59,SMALL(IF({TRUE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;TRUE;TRUE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE;TRUE;TRUE},{1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;40;41;42;43;44;45;46;47;48;49;50;51;52;53;54;55;56;57}),ROW(A3)))

    Each True is converted the it's associated ROW #:

    =INDEX('Daily Chgs'!$B$3:$B$59,SMALL({1;2;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;20;FALSE;FALSE;FALSE;FALSE;25;FALSE;FALSE;FALSE;FALSE;FALSE;31;32;FALSE;FALSE;FALSE;FALSE;37;FALSE;FALSE;FALSE;FALSE;FALSE;43;FALSE;FALSE;FALSE;FALSE;FALSE;49;FALSE;FALSE;FALSE;FALSE;54;FALSE;56;57},ROW(A3)))

    The Final ROW reference which has incremented from the drag down evaluates to 3, and SMALL evaluates to 3rd smallest value thereby skipping all the blank rows and grabbing #20:

    =INDEX('Daily Chgs'!$B$3:$B$59,{20})

    ="WellGuide MWD Tools- Standby "


    The output of the IF just has to have the same number of variables as the expression we evaluate, but starting at 1.

    If you want, you can technically use:

    =INDEX('Daily Chgs'!$B$3:$B$59,SMALL(IF('Daily Chgs'!$B$3:$B$59<>"",ROW('Daily Chgs'!$B$3:$B$59)-ROW($B$2)),ROW(A1)))

    which will keep all the reference identical, in case you insert any rows at the top.

+ 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. type mismatch while trying to filter and copy rows and paste to another worksheet
    By perducci in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2012, 02:59 PM
  2. vba Copy Filter item and paste at other worksheet
    By gingank in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2012, 06:21 AM
  3. Trailing space with copy and paste
    By murphy in forum Excel General
    Replies: 1
    Last Post: 11-04-2008, 02:17 PM
  4. how to filter and copy data from one sheet and paste to new worksheet
    By mr_asrul in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-03-2008, 07:15 AM
  5. Replies: 5
    Last Post: 03-18-2006, 08:45 AM

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