+ Reply to Thread
Results 1 to 5 of 5

Finding up Duplicate Contain Texts Values from the Table & Display as Report

Hybrid View

  1. #1
    Registered User
    Join Date
    12-04-2014
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    19

    Finding up Duplicate Contain Texts Values from the Table & Display as Report

    Finding up Duplicate Contain Texts Values in an Array


    I have 3 columns, one is State, City & X Value as a Table (around 50000 records).

    I need the solution for the below mentioned criteria.

    Input Values: I can input the State in One Cell & City in another cell.
    Table/Database Values: State, City & X Value (in %)

    Once i give the state & city. I need the list of cities which contains the input value & the respective X value.

    Objective is to find out When we input Los Angeles & California in 2 cells.

    We should get the list of rows which contains Los Angeles in California City.

    i.e. Los Angeles East, Los Angeles West, Lake Los Angeles

    IT should display all the Cities name contains Los Angeles in California State.

    For more clarity, i attached a sample file. it would be really useful when someone helps on how to get this report.

    Note: This Result may lead to Maximum of 500 rows.


    This Formula / Macro should do the work on we filtering the first row (heading) of the database -> selecting one state -> under City selecting Filter drop down -> Select Text Filter -> Select Contains .

    Once we do this we will get the result which we need to derive it in a formula / in a Macro.

    Thanks in Advance
    Attached Files Attached Files
    Last edited by Sivashanmugam; 01-07-2015 at 06:02 AM. Reason: Missed the attachment

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Finding up Duplicate Contain Texts Values from the Table & Display as Report

    Maybe:

    Sub Sivashanmugam()
    Dim i As Long
    
    For i = 2 To Range("A" & Rows.Count).End(3).Row
        If Cells(i, "A").Value Like "*" & Cells(2, "H").Value & "*" And Cells(i, "B").Value Like "*" & Cells(3, "H").Value & "*" Then
            Range(Cells(i, "A"), Cells(i, "C")).Copy Range("F" & Rows.Count).End(3)(2)
        End If
    Next i
    End Sub
    BTW your Column Headers are wrong in A/B they should be switched around (ie Arkansas is a State)

  3. #3
    Registered User
    Join Date
    12-04-2014
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    19

    Re: Finding up Duplicate Contain Texts Values from the Table & Display as Report

    Hi John / Apo,

    Thanks for your reply, I tried both of your codes / macro but if we run this macro, it should clear the previous results & show only the new results. now old results are also getting displayed.

    Kindly help in adding the code for: when we give the state & city as input, once we click the button / run the macro, previous results should get cleared & new results should display as results.
    Last edited by Sivashanmugam; 01-08-2015 at 02:56 AM.

  4. #4
    Registered User
    Join Date
    12-04-2014
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    19

    Re: Finding up Duplicate Contain Texts Values from the Table & Display as Report

    Thanks, it solved the problem by including the this code onto it. it has cleared the previous results & shown the current results
    Range("F10:H1000").Cells.ClearContents

    the code i used is

    Private Sub CommandButton1_Click()
    Range("F10:H1000").Cells.ClearContents

    Application.ScreenUpdating = False
    With Cells(1).CurrentRegion
    .AutoFilter 1, "*" & [H2] & "*": .AutoFilter 2, "*" & [H3] & "*"
    .Offset(1).Resize(.Rows.Count - 1).SpecialCells(12).Copy [F10]
    .AutoFilter
    End With
    Application.ScreenUpdating = True
    End Sub

  5. #5
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Finding up Duplicate Contain Texts Values from the Table & Display as Report

    For 50 000 records.. maybe autofilter..

    Private Sub CommandButton1_Click()
        Application.ScreenUpdating = False
        With Cells(1).CurrentRegion
            .AutoFilter 1, "*" & [H2] & "*": .AutoFilter 2, "*" & [H3] & "*"
            .Offset(1).Resize(.Rows.Count - 1).SpecialCells(12).Copy [F10]
            .AutoFilter
        End With
        Application.ScreenUpdating = True
    End Sub
    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)

Similar Threads

  1. Report Filter when using texts from column
    By managingcrap in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-25-2014, 04:34 PM
  2. Finding duplicate values
    By sagar in forum Excel General
    Replies: 2
    Last Post: 02-23-2014, 03:39 AM
  3. [SOLVED] Filter / Report Top 10 Values with identifier into new spreadsheet / table / report style
    By steverokh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2013, 05:10 AM
  4. Replies: 3
    Last Post: 11-09-2012, 09:41 PM
  5. Finding Duplicate Values in a Col,
    By Rajkumar in forum Excel General
    Replies: 2
    Last Post: 03-05-2008, 09:33 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