Hi Paul, Thanks a ton for your help, Code not satisfying below object.
if values in the criteria sheet not found in raw data sheet , values of should highlight in another color in criteria sheet or should paste in results sheet. Truly appreciate your efforts.Once again thanks for your support. Regards Bolla Manikanta On Mon, Oct 12, 2015 at 8:02 PM, Paul Schreiner <schreiner_p...@att.net> wrote: > I went ahead and used =RANDBETWEEN() to randomly generate a sample file of > 80,000 rows of data. > I then created a list of the top 20 state/district combinations. > > I filter the Criteria sheet and run the macro: Report_Filtered_Records > > it takes anywhere from 15 to 45 seconds to search through the 80,000 > records. > > It's not as "elegant" as I'd like, but it does work. > > see if you can implement it: > Option Explicit > Public Dict_Fields > Sub Report_Filtered_Records() > Dim stat > Dim nRows, R, rOut > Dim strCountry, strState, strDistrict > Dim KeyField > > Application.ScreenUpdating = False > Sheets("Result").Range("A2:Z165000").ClearContents > > stat = Load_Dict_Fields() > > rOut = 1 > nRows = Application.WorksheetFunction.CountA(Sheets("Raw > Data").Range("A:A")) > For R = 2 To nRows > strCountry = Sheets("Raw Data").Cells(R, "A").Value > strState = Sheets("Raw Data").Cells(R, "B").Value > strDistrict = Sheets("Raw Data").Cells(R, "C").Value > KeyField = strCountry & "." & strState & "." & strDistrict > If (Dict_Fields.exists(KeyField)) Then > rOut = rOut + 1 > Sheets("Result").Range("A" & rOut & ":E" & rOut) = > Sheets("Raw Data").Range("A" & R & ":E" & R).Value > End If > Next R > Application.ScreenUpdating = True > Sheets("Result").Select > MsgBox "Reported " & rOut - 1 & " rows" > End Sub > Function Load_Dict_Fields() > Dim R, nRows > Dim strCountry, strState, strDistrict > Dim KeyField > Set Dict_Fields = CreateObject("Scripting.Dictionary") > Dict_Fields.RemoveAll > > nRows = > Application.WorksheetFunction.CountA(Sheets("Criteria").Range("A:A")) > For R = 2 To nRows > If (Sheets("Criteria").Cells(R, "A").EntireRow.Hidden = False) Then > strCountry = Sheets("Criteria").Cells(R, "A").Value > strState = Sheets("Criteria").Cells(R, "B").Value > strDistrict = Sheets("Criteria").Cells(R, "C").Value > KeyField = strCountry & "." & strState & "." & strDistrict > If (Not Dict_Fields.exists(KeyField)) Then > Dict_Fields.Add KeyField, Sheets("Criteria").Cells(R, > "D").Value & "|" & Sheets("Criteria").Cells(R, "E").Value > End If > End If > Next R > Load_Dict_Fields = True > End Function > > > > *Paul* > ----------------------------------------- > > > > > > > > *“Do all the good you can,By all the means you can,In all the ways you > can,In all the places you can,At all the times you can,To all the people > you can,As long as ever you can.” - John Wesley* > ----------------------------------------- > > ------------------------------ > *From:* mani bolla <bollam...@gmail.com> > *To:* MS EXCEL AND VBA MACROS <excel-macros@googlegroups.com> > *Sent:* Sunday, October 11, 2015 6:00 AM > *Subject:* $$Excel-Macros$$ How to apply multiple filters based on > multiple criteria > > Hi All, > > i am looking for VBA code for below objective there are three sheets > 1.Raw data 2.Criteria 3.Result > Raw data sheet has 5 columns ( country, state, district, name, age ) , 80 > thousand rows, may be duplicate rows also > Criteria sheet has 3 columns (country, state, district) , 20 rows. unique > values > i need to apply filters in raw data sheet with visible values of criteria > sheet , if values are not found in raw data sheet , values of should > highlight in another color in criteria sheet. > what are the values found in raw data sheet (including duplicate rows) > should copy and paste in results sheet. > Request you to provide VBA code for this objective. Once again thanks for > your support > -- > Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s > =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ > https://www.facebook.com/discussexcel > > FORUM RULES > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > 2) Don't post a question in the thread of another member. > 3) Don't post questions regarding breaking or bypassing any security > measure. > 4) Acknowledge the responses you receive, good or bad. > 5) Jobs posting is not allowed. > 6) Sharing copyrighted material and their links is not allowed. > > NOTE : Don't ever post confidential data in a workbook. Forum owners and > members are not responsible for any loss. > --- > You received this message because you are subscribed to the Google Groups > "MS EXCEL AND VBA MACROS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to excel-macros+unsubscr...@googlegroups.com. > To post to this group, send email to excel-macros@googlegroups.com. > Visit this group at http://groups.google.com/group/excel-macros. > For more options, visit https://groups.google.com/d/optout. > > > -- > Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s > =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ > https://www.facebook.com/discussexcel > > FORUM RULES > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > 2) Don't post a question in the thread of another member. > 3) Don't post questions regarding breaking or bypassing any security > measure. > 4) Acknowledge the responses you receive, good or bad. > 5) Jobs posting is not allowed. > 6) Sharing copyrighted material and their links is not allowed. > > NOTE : Don't ever post confidential data in a workbook. Forum owners and > members are not responsible for any loss. > --- > You received this message because you are subscribed to a topic in the > Google Groups "MS EXCEL AND VBA MACROS" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/excel-macros/ozTXDsoPXhs/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > excel-macros+unsubscr...@googlegroups.com. > To post to this group, send email to excel-macros@googlegroups.com. > Visit this group at http://groups.google.com/group/excel-macros. > For more options, visit https://groups.google.com/d/optout. > -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.