Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Delete all rows where column A is blank

I need to write a macro to delete all rows where column A is blank. Can
anyone help me with this please?
--
Thank you, Jodie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Delete all rows where column A is blank

Try some code like the following. Change the value "Sheet1" to the
appropriate worksheet name.


Sub AAA()
Dim LastRow As Long
Dim RowNdx As Long
Dim WS As Worksheet
Set WS = Worksheets("Sheet1")
With WS
LastRow = .UsedRange.SpecialCells(xlCellTypeLastCell) _
.EntireRow.Cells(1, "A")
For RowNdx = LastRow To 1 Step -1
If .Cells(RowNdx, "A").Value = vbNullString Then
.Rows(RowNdx).Delete
End If
Next RowNdx
End With
End Sub

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]



On Thu, 10 Dec 2009 13:59:01 -0800, Jodie
wrote:

I need to write a macro to delete all rows where column A is blank. Can
anyone help me with this please?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Delete all rows where column A is blank

Try this

Range("A:A").SpecialCells(xlCellTypeBlanks).Entire Row.Delete

"Jodie" wrote in message
...
I need to write a macro to delete all rows where column A is blank. Can
anyone help me with this please?
--
Thank you, Jodie


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Delete all rows where column A is blank

Warning: Look out with SpecialCells

See
http://www.rondebruin.nl/specialcells.htm




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Homey" <noname wrote in message ...
Try this

Range("A:A").SpecialCells(xlCellTypeBlanks).Entire Row.Delete

"Jodie" wrote in message
...
I need to write a macro to delete all rows where column A is blank. Can
anyone help me with this please?
--
Thank you, Jodie


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Delete all rows where column A is blank

Do you really need a macro?

Select column A

F5SpecialBlanksOK

EditDeleteEntire Row


Gord Dibben MS Excel MVP


On Thu, 10 Dec 2009 13:59:01 -0800, Jodie
wrote:

I need to write a macro to delete all rows where column A is blank. Can
anyone help me with this please?


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 if column looks blank [email protected] Excel Programming 4 February 18th 09 07:21 PM
delete the non blank rows depending on Column Harn88 Excel Programming 1 November 18th 08 08:37 AM
Delete Blank Rows - specify column via dialog porter444 Excel Programming 1 November 30th 07 04:45 PM
Delete Rows if any cell in Column H is blank but do not Delete Fir manfareed Excel Programming 4 September 28th 07 05:20 PM
Delete entire rows where there is a blank in column A Chris Hankin[_2_] Excel Programming 7 June 11th 06 09:56 AM


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