Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default delete rows in a given range

I'm pretty sure this non-looping macro will do what you want (assuming your
values in Column C are constants and not formula results)...

Sub DeleteRows()
On Error Resume Next
Intersect(Columns("A").SpecialCells(xlCellTypeBlan ks).EntireRow, _
Columns("C").SpecialCells(xlCellTypeConstants).Ent ireRow).Delete
End Sub

If Column C contains formulas, not constants, then replace the
xlCellTypeConstants argument with xlCellTypeFormulas in the above code.

--
Rick (MVP - Excel)


"Wen" wrote in message
...
Anyone has a good sub to delete from a given range any row with blank
index cell?
For example, I have a table range with column A titled "Name" as index
column. I need a sub that deletes any row where column A is blank, but
say, column C has non-blank value. it is not the same as deleting all
blank rows in a range.
TIA.
Wen


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
delete rows in a given range Ryan H Excel Programming 0 November 27th 09 04:20 PM
delete rows in a given range Don Guillett Excel Programming 0 November 27th 09 04:07 PM
Delete rows if not as range Kashyap Excel Programming 3 March 29th 09 11:11 AM
delete rows in range - macro hindu cliparts Excel Worksheet Functions 0 November 16th 06 09:54 PM
Delete a range of rows ? SpookiePower Excel Programming 6 January 24th 06 03:24 PM


All times are GMT +1. The time now is 10:59 AM.

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

About Us

"It's about Microsoft Excel"