Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
mohd21uk via OfficeKB.com
 
Posts: n/a
Default Delete a row if blank cell

Hi,

I would like to delete a row if the a cell in a column is blank. For e.g. if
a cell in column E is blank I would like to delete the whole row. I would
like to do this in VBA code

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...l-new/200604/1
  #2   Report Post  
Posted to microsoft.public.excel.newusers
CLR
 
Posts: n/a
Default Delete a row if blank cell

Here's one I got from the group some time ago.....sorry, don't remember who
or when..........

Public Sub DeleteBlanks()
With ActiveSheet
.Range(.Cells(1, ActiveCell.Column), _
.Cells(65536, ActiveCell.Column)).Select
End With
Selection.SpecialCells(xlCellTypeBlanks).EntireRow .Delete
ActiveSheet.UsedRange
ActiveCell.Select
End Sub

Vaya con Dios,
Chuck, CABGx3



"mohd21uk via OfficeKB.com" wrote:

Hi,

I would like to delete a row if the a cell in a column is blank. For e.g. if
a cell in column E is blank I would like to delete the whole row. I would
like to do this in VBA code

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...l-new/200604/1

  #3   Report Post  
Posted to microsoft.public.excel.newusers
Don Guillett
 
Posts: n/a
Default Delete a row if blank cell

or

Sub DeleteBlankRowsInActiveColumn()
ac = ActiveCell.Column
lr = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
Range(Cells(1, ac), Cells(lr, ac)). _
SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub

--
Don Guillett
SalesAid Software

"mohd21uk via OfficeKB.com" <u20517@uwe wrote in message
news:5eb7b0aab4723@uwe...
Hi,

I would like to delete a row if the a cell in a column is blank. For e.g.
if
a cell in column E is blank I would like to delete the whole row. I would
like to do this in VBA code

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...l-new/200604/1


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
Instead of a negative number, I'd like to show zero... Dr. Darrell Excel Worksheet Functions 6 December 7th 05 08:21 PM
Want #VALUE! to show as blank cell JoeyW Excel Worksheet Functions 2 November 4th 05 09:24 AM
How to delete blank rows John Mansfield Excel Discussion (Misc queries) 3 April 27th 05 11:48 PM
blank cell turns to 0 LMB New Users to Excel 2 April 25th 05 03:57 PM
VLookup resulting in a blank cell... KempensBoerke Excel Worksheet Functions 1 October 28th 04 09:57 PM


All times are GMT +1. The time now is 05:46 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"