Seclec

G

Guest

Is there a code or a way to seclec row to delete with out spisifing the row
range or cell? Please see "<---" below. Thanks

Selection.AutoFilter Field:=9, Criteria1:="="
Range("A42861:I42861").Select <--- It would be for this range of rows
Range("I42861").Activate
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Delete
Range("I42861").Select
Selection.AutoFilter Field:=9
or
Selection.AutoFilter Field:=9, Criteria1:="="
Rows("2:2").Select <--- or for this range of rows
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter Field:=9
Range("A2").Select
 
G

Guest

Rows is a range object.
you can simply do:
rows("2:2").Delete Shift:=xlUp
or
rows(2).Delete Shift:=xlUp

you do not need to select it
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top