any way i can re-write this?
Posted by randy on September 14, 2001 11:30 AM
My 'if not is empty range' needs to increase by 1 each time (b8,b9,b10...etc) and my criteria range needs to change by 1 also (ae1,af1,ag1..etc)
right now i have 13 of these if thens and want to switch it to some sort of loop (mabey)
If Not IsEmpty(Range("INFO!B8")) Then
Sheets("SHEET3").Range("SHEET3!$P$1:$AB$500").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"SHEET3!$AE$1:$AE$2"), CopyToRange:=Range("SHEET3!$AS$1:$BE$1"), Unique:=False
Sheets("SINGLE").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End If
If Not IsEmpty(Range("INFO!B9")) Then
Sheets("SHEET3").Range("SHEET3!$P$1:$AB$500").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"SHEET3!$AF$1:$AF$2"), CopyToRange:=Range("SHEET3!$AS$1:$BE$1"), Unique:=False
Sheets("SINGLE").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End If