Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-11-2018, 07:19 AM
LearnerExcel LearnerExcel is offline How to modify code for Auto filter based on two criteria ... Windows 7 32bit How to modify code for Auto filter based on two criteria ... Office 2003
Advanced Beginner
How to modify code for Auto filter based on two criteria ...
 
Join Date: Nov 2016
Posts: 82
LearnerExcel will become famous soon enoughLearnerExcel will become famous soon enough
Default How to modify code for Auto filter based on two criteria ...

How to modify the following code for Auto filter to search based on two criteria ...
Like : CriteriaRange:=Range("E1:E2") & CriteriaRange:=Range("F1:F2")


Code:
 
PrivateSubWorksheet_Change(ByValTarget AsRange)
'Updateby Extendoffice 20160606
   IfTarget.Address = Range("E2").Address Then
       Range("A1:C20").CurrentRegion.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=Range("E1:E2")
   EndIf
EndSub
Source: https://www.extendoffice.com/documen...ell-value.html
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to modify code for Auto filter based on two criteria ... Sum based on multiple criteria (one of the criteria is not unique) until a threshold is reached. phillipsdp Excel 1 11-09-2016 12:53 AM
How to modify code for Auto filter based on two criteria ... Filter Mail Merge based on a list of filter criteria AusSteelMan Mail Merge 2 05-09-2016 03:35 PM
Auto fill drops down using VBA code based on selection AgilityJS Word VBA 5 11-03-2015 07:50 PM
Forgotten Sort and Filter Criteria rbdmg Mail Merge 0 10-31-2011 09:14 PM
Modify vba code to print based on name in the InputBox OTPM Project 0 05-25-2011 02:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:54 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft