I have a spreadsheet that contains a list of items available from a storeroom. I would to be able to filter a quantity column to show any nonblanks and then copy the rows over to another sheet. I have the code created for this but here is my problem. How do I select the rows when the row numbers will change? Depending which rows have a number in them the rows present after the filter will change. I need to copy the rows that are not blank no matter of the rows number. Below is the code I have so far, the line I am having problems with is "Range("A2:D4").Select". I have also attached a small example of what i working with. The actual spreadsheet has hundreds of possible rows.
Store.xls
Sub Macro1()
'
Columns("C:C").Select
Selection.AutoFilter
ActiveSheet.Range("C:C").AutoFilter Field:=1, Criteria1:="<>"
Range("A2:D4").Select
Selection.Copy
Sheets("Sheet2").Select
Range("D3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Application.CutCopyMode = False
Selection.AutoFilter
End Sub
Bookmarks