+ Reply to Thread
Results 1 to 5 of 5

Select All Rows Sharing Value in one Column, after finding different value in another

Hybrid View

  1. #1
    Registered User
    Join Date
    08-10-2006
    Location
    Los Angeles, California
    MS-Off Ver
    2013 64-bit
    Posts
    39

    Select All Rows Sharing Value in one Column, after finding different value in another

    I have a spreadsheet where I'd like to find records based on a value in one column, then select all records based on the values in a second column so I can drill down. Is this possible?

    For instance, see the example attached. I'd like to find all instances where the "Tender" was "Visa", then select all records with the same account numbers - regardless if the tender was Visa or not. My goal is to find all accounts records where a Visa was used on at least instance.

    Thanks.

    Excel Example.PNG

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Select All Rows Sharing Value in one Column, after finding different value in another

    Available method/tools will depend on your Excel version. Please update your profile with Excel version that you use.
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    08-10-2006
    Location
    Los Angeles, California
    MS-Off Ver
    2013 64-bit
    Posts
    39

    Re: Select All Rows Sharing Value in one Column, after finding different value in another

    Quote Originally Posted by CK76 View Post
    Available method/tools will depend on your Excel version. Please update your profile with Excel version that you use.
    Done (Excel 2013 64-bit)

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Select All Rows Sharing Value in one Column, after finding different value in another

    If you can use vba I'd do it like below.
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim ar
    If Not Intersect(Target, [A2]) Is Nothing Then
        If Len(Target.Value) = 0 Then
            ListObjects(1).AutoFilter.ShowAllData
        Else
            ar = ListObjects(1).DataBodyRange.Value
            With CreateObject("Scripting.Dictionary")
                For i = 1 To UBound(ar)
                    If ar(i, 3) = Target.Value Then
                        .Item(CStr(ar(i, 1))) = 1
                    End If
                Next
                ListObjects(1).Range.AutoFilter 1, .Keys, 7
            End With
                
        End If
    End If
        
    End Sub
    See attached.

    If you have access to PowerQuery, there are other options.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-10-2006
    Location
    Los Angeles, California
    MS-Off Ver
    2013 64-bit
    Posts
    39

    Re: Select All Rows Sharing Value in one Column, after finding different value in another

    Thanks! And thank you for introducing me to Power Query - I'm going to be looking into that.

+ 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. [SOLVED] Select last row in column A and select 49 rows up, copy results to A2
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2016, 02:59 PM
  2. [SOLVED] Finding todays date in column A then select adjacent cell
    By L plates in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-03-2016, 10:50 AM
  3. Select cell by finding column and row
    By 13gentj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2015, 01:18 AM
  4. [SOLVED] Help with select a column after finding text
    By jnh0 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2013, 05:39 AM
  5. Easy problem for you, select rows after finding text string, delete selection
    By yeoman12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2009, 09:08 PM
  6. Finding last cell in a column, select, copy/paste
    By GaretJjax in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-16-2008, 05:17 PM
  7. [SOLVED] Select column by finding the text
    By cheenu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2006, 12:55 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