+ Reply to Thread
Results 1 to 4 of 4

Returning all the values in a column based on the column header

  1. #1
    Registered User
    Join Date
    03-10-2010
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    63

    Returning all the values in a column based on the column header

    I'm hoping someone can help me out with this problem I'm having in excel. I would like to write a VB script that takes an input value and searches row 1 for that input value. When it finds it, I need it to return all of the values in the column where the value was located, and ignore any blank cells.

    I've attached a sample document that shows what the current data looks like.

    For example, if the value I'm looking for is 02, it should return all of the numbers in column B

    Any help creating this macro would be greatly appreciated.

    Thanks,
    Chris
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    09-05-2012
    Location
    Dallas, Tx
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Returning all the values in a column based on the column header

    Would using the filters get you what your looking for?

    Under the data Tab, click filter.

    Then click the filter button under the B column.

    ColumnFind1.jpg

    Then unclick the blank cell check box.

    Now you only see the items in that column.
    ColumnFind2.jpg

    Then click the filter button again to reset the data.


    <----- Please click the star if this helps you
    http://excelevangelist.blogspot.com/

  3. #3
    Registered User
    Join Date
    03-10-2010
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    63

    Re: Returning all the values in a column based on the column header

    The filter wont help me. I need to be able to input one of the header values on a different sheet and have it return a list of the numbers that correspond with that header.

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Returning all the values in a column based on the column header

    may be so. Try to change the value in A1 on sheet2.
    Previously run this macro for Sheet1
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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