Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Delete Certain Rows

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Delete Certain Rows

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

Would be one way.

scrabtree23 wrote:

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


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Delete Certain Rows


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)


"scrabtree23" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hpw do I delete multiple empty rows found between filled rows? Bill Excel Worksheet Functions 2 November 15th 09 07:12 PM
How to Delete empty rows in excel in b/w rows with values Dennis Excel Worksheet Functions 3 August 28th 07 04:15 PM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Excel Worksheet Functions 0 December 13th 06 01:25 AM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below Annette[_4_] Excel Programming 2 September 21st 04 02:40 PM


All times are GMT +1. The time now is 08:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"