Excel Programming >> Copying the entire sheet if columns H & G are equal to row.
Hi, I wanted to know.
If i have a worksheet, I want to create a code that will copy rows i
their Column H & G are both equal to "0" to another worksheet whic
will be called missing
I started to but I am having problems with naming the selection.
Sub paste()
Range("A12:M12").Select ' select Header row
Selection.AutoFilter
'copy all where column H and G is zero
Selection.Columns ("H:G"), Criteria1:="0", Operator:=xlAnd
Rows("13:2000").Select
Selection.Copy Shift:=xlUp
'Reset filter
Selection.Columns ("H:G")
'Paste to new sheet "missing "
Sheets("missing").Select
Range("A3").Select
Selection.PasteSpecial paste:=xlPasteColumnWidths
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.paste