PC Review


Reply
Thread Tools Rate Thread

Delete all rows where column A is blank

 
 
Jodie
Guest
Posts: n/a
 
      10th Dec 2009
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
 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      10th Dec 2009
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
<(E-Mail Removed)> wrote:

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

 
Reply With Quote
 
Homey
Guest
Posts: n/a
 
      11th Dec 2009
Try this

Range("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete

"Jodie" <(E-Mail Removed)> wrote in message
news:8EC6D56C-362F-4DDF-93B3-(E-Mail Removed)...
> 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


 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      11th Dec 2009
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 news:(E-Mail Removed)...
> Try this
>
> Range("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
>
> "Jodie" <(E-Mail Removed)> wrote in message
> news:8EC6D56C-362F-4DDF-93B3-(E-Mail Removed)...
>> 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

>

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      11th Dec 2009
Do you really need a macro?

Select column A

F5>Special>Blanks>OK

Edit>Delete>Entire Row


Gord Dibben MS Excel MVP


On Thu, 10 Dec 2009 13:59:01 -0800, Jodie <(E-Mail Removed)>
wrote:

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


 
Reply With Quote
 
Jodie
Guest
Posts: n/a
 
      14th Dec 2009
Yes Gord, I will be adding this to another macro and be using it multiple
times for spreadsheets of different sizes.
--
Thank you, Jodie


"Gord Dibben" wrote:

> Do you really need a macro?
>
> Select column A
>
> F5>Special>Blanks>OK
>
> Edit>Delete>Entire Row
>
>
> Gord Dibben MS Excel MVP
>
>
> On Thu, 10 Dec 2009 13:59:01 -0800, Jodie <(E-Mail Removed)>
> wrote:
>
> >I need to write a macro to delete all rows where column A is blank. Can
> >anyone help me with this please?

>
> .
>

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      14th Dec 2009
OK

Thanks for posting.

I think others gave you the code.


Gord

On Mon, 14 Dec 2009 06:30:01 -0800, Jodie <(E-Mail Removed)>
wrote:

>Yes Gord, I will be adding this to another macro and be using it multiple
>times for spreadsheets of different sizes.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete rows if column looks blank robyn_willson@hotmail.com Microsoft Excel Programming 4 18th Feb 2009 07:21 PM
delete the non blank rows depending on Column Harn88 Microsoft Excel Programming 1 18th Nov 2008 08:37 AM
Delete Blank Rows - specify column via dialog porter444 Microsoft Excel Programming 1 30th Nov 2007 04:45 PM
Delete Rows if any cell in Column H is blank but do not Delete Fir =?Utf-8?B?bWFuZmFyZWVk?= Microsoft Excel Programming 4 28th Sep 2007 05:20 PM
Delete entire rows where there is a blank in column A Chris Hankin Microsoft Excel Programming 7 11th Jun 2006 09:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:55 PM.