Delete Certain Rows

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like a VBA code to delete certain rows on a sheet.

If I use xldown it will go to the last row of data in a table. There is
more data on the sheet below this but there is a line that is skipped between
the target table and the additional data. So, I want to select cell A:1,
then do an xldown to get to the last row in the target table. I then want to
delete row 3:3 through the desired last row.

How?

Thanks
 
dim LastCell as range
with worksheets("sheet1")
set lastcell = .range("a1").end(xldown)
.range("a3",lastcell).entirerow.delete
end with

Would be one way.
 
cLastRow = Cells(Rows.Count,"A").end(xlUp).Row
Range("A3:A" & clastrow).entirerow.delete

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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

Back
Top