+ Reply to Thread
Results 1 to 4 of 4

Selecting a range of values and returning the whole line

  1. #1
    Forum Contributor
    Join Date
    07-26-2013
    Location
    Athens, Greece (born and raised in Sydney, Australia)
    MS-Off Ver
    Excel 2010
    Posts
    114

    Question Selecting a range of values and returning the whole line

    Hi,

    I have a sheet with 10,000 lines of entry. My example below is only 5 lines just to describe my query.

    I would like to be able to select a range of values from a column (i.e. select from column A entries in the range 1.6 through to 1.9) and return the whole line to another sheet or elsewhere. In other words the whole of line 2 through to line 5 will be selected and copied elsewhere.

    Can this sort of copy/paste be performed without manually using copy/paste functionality?

    A B C D E F G H I J K L M N O P
    1.5 6.0 7.0 1.2 1.8 3.5 6.0 3.0 180 350 4 1 1 1 0 6
    1.6 3.0 7.0 2.3 7.0 1.8 3.0 1.5 180 350 4 0 2 1 3 3
    1.7 3.0 3.0 1.5 3.0 3.0 3.0 1.0 185 320 2 1 0 0 1 2
    1.8 4.5 4.0 2.0 1.6 8.0 9.0 3.0 185 325 6 1 2 2 2 4
    1.9 6.0 3.0 2.0 1.5 6.0 6.0 1.5 185 350 4 1 1 2 1 3

    Thanks

    John Sio

  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
    52,933

    Re: Selecting a range of values and returning the whole line

    Hi and welcome to the forum

    See if the attached is something you can work with?

    On sheet2 change the values in B1:B3 to see the table below change accordingly
    Attached Files Attached Files
    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
    Forum Contributor
    Join Date
    07-26-2013
    Location
    Athens, Greece (born and raised in Sydney, Australia)
    MS-Off Ver
    Excel 2010
    Posts
    114

    Re: Selecting a range of values and returning the whole line

    Thank you, I appreciate your reply.

    However, i am pretty much a newcomer when it comes to excel so looking at your formulas/code etc seems very in depth to me.

    Regardless, i will try and work it out. I will most probably be back with more questions!

    Thanks again

  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
    52,933

    Re: Selecting a range of values and returning the whole line

    Ask away if you dont understand anything

    On sheet1, the helper column 1st tests the column (in the sample, column A) for values between the criteria set on sheet2 B2 and B3. If it is within the criteria, it adds a 1 to the highest value above it (so, for the 1st match, it adds 1 to 0, for the next match, it adds 1 to 1, and so on)

    Then on sheet1, I use this increasing sequence of numbers to select teh row to return the values from. With a vlookup or index/match, it will only ever give you the 1st instance of a "find", so once it has found "1", it wont look for another "1"

  5. #5
    Forum Contributor
    Join Date
    07-26-2013
    Location
    Athens, Greece (born and raised in Sydney, Australia)
    MS-Off Ver
    Excel 2010
    Posts
    114

    Re: Selecting a range of values and returning the whole line

    thanks again

    fantastic work

+ 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. Selecting a range and sum values
    By mtt23 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-15-2012, 04:19 PM
  2. Looking up a Range and selecting Values
    By bitswit in forum Excel General
    Replies: 3
    Last Post: 11-25-2011, 02:27 AM
  3. Returning Row Heading for Top 'X' values in a range
    By Powermonger in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-28-2008, 06:04 PM
  4. Selecting a range of values for another function
    By Sergun in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-24-2005, 06:50 PM
  5. Selecting range based on values
    By Alan M in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2005, 02:06 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