Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using the following code to cycle through criteria. However, if the data
does not match the criteria, I get all of the rows pasted to the new sheet. How can this be prevented? WshName, FCriteria and FCriteria2 are arrays. This code works when the data contains the 2 criteria. For a = y To z Sheets(WshName(x)).Select Range("B1").Select Selection.AutoFilter Selection.AutoFilter Field:=2, Criteria1:=FCriteria(a) Range("C1").Select Selection.AutoFilter Field:=3, Criteria1:=FCriteria2(a) Application.CutCopyMode = False Range("A2:AV" & EndCell).Select Selection.Copy Sheets(WshName(a)).Select Range("A2").Select ActiveSheet.Paste Range("A2").Select Next a |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selection.AutoFilter Field / Criteria = criteria sometimes non-existing on worksheet | Excel Programming | |||
Command Line. How to tell to XL : If the xls file exist : Open it, if it does not exist : Create it. | Excel Programming | |||
3 criteria must exist in adjoining cells then rtn val from 4th | Excel Discussion (Misc queries) | |||
How to use autofilter to delete duplicate rows (2nd criteria) ? | Excel Programming | |||
Prevent users from using AutoFilter | Excel Programming |