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...
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...