I wanted to delete rows from 2 to z (z > 2). I wrote 2 methods but neither worked. I searched for answers but didn't find a solution.
'.Rows("2:" & z).Select
.Range(Cells(2, 1), Cells(z, 10)).Select
Selection.Delete Shift:=xlUp
Thank you in advance.
Selecton isn't theActiveSheet, you'll get a run-time error 1004 for 2 reasons: theCellscalls aren't qualified, and you can't select cells on the non-active sheet. Qualify all your references, and use theRangeobjects - not the selection.