I have three worksheets
1.ConditionSheet : Having conditions value in cell E5 & E7
2.SourceSheet : Complete Data
3.TargetSheet : When I run macro New worksheet create with this name based on conditionSheet Value.
From SourceSheet I want to create new worksheet with specific data.
In ConditionSheet Cell E5 having 1st critere and E7 having second Critera
Based on this I want to create New worksheet name 'TargetSheet'
In this only those data copy from SourceSheet whose Column F value is match with E5 Cell value in ConditionalSheet & Column H of SourceSheet value mathc with E7 value of ConditionalSheet
The Second criteria is optional so I used IIF function to pass condition.
Following command copied all the data from sourcesheet whether it is one or two condition.
I want to copy only data based on criteria.
Please guide me.
(Thanks for viewer and replied users)
__________________________________________________________________
1.ConditionSheet : Having conditions value in cell E5 & E7
2.SourceSheet : Complete Data
3.TargetSheet : When I run macro New worksheet create with this name based on conditionSheet Value.
From SourceSheet I want to create new worksheet with specific data.
In ConditionSheet Cell E5 having 1st critere and E7 having second Critera
Based on this I want to create New worksheet name 'TargetSheet'
In this only those data copy from SourceSheet whose Column F value is match with E5 Cell value in ConditionalSheet & Column H of SourceSheet value mathc with E7 value of ConditionalSheet
The Second criteria is optional so I used IIF function to pass condition.
Following command copied all the data from sourcesheet whether it is one or two condition.
Code:
Sheets("SourceSheet").Range("A1:AB" & Worksheets("TargetSheet").Rows.Count).AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=IIf(Sheets("ConditionSheet").Range("E7") = "", Sheets("ConditionSheet").Range("E5:E5"), Sheets("ConditionSheet").Range("E5:E7")), _
CopyToRange:=Sheets("TargetSheet").Range("A1"), _
Unique:=True
I want to copy only data based on criteria.
Please guide me.
(Thanks for viewer and replied users)
__________________________________________________________________
Mod edit : post moved again to appropriate forum ‼