View Single Post
 
Old 06-20-2014, 11:25 PM
shilabrow shilabrow is offline Windows Vista Office 2007
Advanced Beginner
 
Join Date: Apr 2014
Posts: 45
shilabrow is on a distinguished road
Default How to Insert more criteria in Macro

I have the following macro below and I want to add more criteria into it. The criteria is:
For fieldName (Activity) in the Sheet, whenever it sees 4 under Activity field should change number to Book, 5 to Elephant, 6 to Hunter and so on. This way, am able to Filter and change Activity name all together when I run the code. All help appreciated. Thanks much!


Sub Prices()
'Prices Macro
'
Selection.AutoFilter
ActiveSheet.listObjects("MyDatabse"). Range._
Autofilter Field:=4, Criteria1:="=yes", Operator:=xlOr, Criteria2:="="
ActiveSheet.ListObjects("MyDatabase").Range._
AutoFilter:=6, Criteria1:="=Complete", Operator:=xlOr,Criteria2_
:="="
Cells.Select
Selection.Copy
Sheets("Result").Select
Range("A1").Select
ActiveSheet.Paste
End sub
Reply With Quote