Autofilter Criteria Not Met

mlin2328

New Member
Joined
May 23, 2014
Messages
3
Hi there,

I'm trying to copy and paste a table filtered by a criteria.. It's working fine when the value exists, but when the value is not available.. e.g. "0", it's copying the entire unfiltered table and pasting. I want it to do nothing.. any tips? Thanks in advance!

Sub Property16()
Sheet16.Select
Sheet16.Range("$F$2:$P$52").AutoFilter Field:=2, Criteria1:="0"
Range("F3:P3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Range("Z3").Select
Sheet16.Paste
Sheet16.Range("$F$2:$P$52").AutoFilter Field:=2, Criteria1:="=0"
Range("E3:P52").Select
Selection.Copy
Sheets("Market Ranking - Studio").Select
LastRow = Application.WorksheetFunction.CountA(Sheet15.Cells.Range("A1:A500")) + 3
Range("A" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False


etc...
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,215,537
Messages
6,125,389
Members
449,222
Latest member
taner zz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top