LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How can I Delete rows were the first cell is blank?

this seems to miss rows if there are two or more adjacent rows that have
blanks in column A.





--
Regards,
Tom Ogilvy


"Duncan" wrote:

oops...

replace "Application.EnableEvents" for "Application.ScreenUpdating"

so it looks like this..


Application.ScreenUpdating = False
Range("A1").Select
i = 1
Do
ActiveCell.Offset(1, 0).Select
If ActiveCell.Value = "" Then
ActiveCell.EntireRow.Delete
End If
i = i + 1
Loop Until i = 40
Application.ScreenUpdating = True



Duncan





Duncan wrote:

will search for empty cells in column A, change if necessary..


Application.EnableEvents = False
Range("A1").Select
i = 1
Do
ActiveCell.Offset(1, 0).Select
If ActiveCell.Value = "" Then
ActiveCell.EntireRow.Delete
End If
i = i + 1
Loop Until i = 500
Application.EnableEvents = True


Bit slow though, replace 500 for your maximum amount of cells.

like i said, bit slow, sure theres a faster way but this will work in
the meantime

Duncan


Mascot wrote:

HI,

I was wondering if there is Macro for this. I have a spreadsheet were
periodically
throughout column a the first cell is blank (the rest of the row
has Data but I don't need it. Does some one have a macro that will search for
these blank cells and delete the row?

Thanks
Mascot



 
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
macro to delete rows if cell blank in column puiuluipui Excel Discussion (Misc queries) 4 October 15th 09 05:22 PM
Delete multiple rows where a blank cell is located kippers Excel Discussion (Misc queries) 2 April 11th 08 11:18 AM
To delete rows when more than one cell is blank [email protected] Excel Worksheet Functions 4 September 27th 06 10:49 PM
Delete rows ere first cell is blank but ohters celld have data? Mascot Excel Programming 1 July 26th 06 03:44 AM
Delete blank row only if 2 consecutive blank rows Amy Excel Programming 2 October 21st 04 05:24 PM


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