Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Delete rows ere first cell is blank but ohters celld have data?

HI,

I was wondering if there is Macro for this. I have a spreadsheet were the
soardically 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 cells and delete the row?

Thanks
Mascot
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Delete rows ere first cell is blank but ohters celld have data?

I happened to be here yesterday.
http://www.angelfire.com/biz7/julian...ans_macros.htm
First select all the cells in the column

Sub DelEmptyRow()
Dim rng As Integer
Dim i As Integer

rng = Selection.Rows.Count
ActiveCell.Offset(0, 0).Select
Application.ScreenUpdating = False
For i = 1 To rng
If ActiveCell.Value = "" Then 'You can replace "" with 0 to delete rows
with 'the value zero
Selection.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
Next i
Application.ScreenUpdating = True
End Sub



Mascot wrote:
HI,

I was wondering if there is Macro for this. I have a spreadsheet were the
soardically 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 cells and delete the row?

Thanks
Mascot


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200607/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
macro to delete rows if cell blank in column puiuluipui Excel Discussion (Misc queries) 4 October 15th 09 05:22 PM
Macro to delete blank rows in a data range Youlan Excel Discussion (Misc queries) 5 September 17th 08 08:51 AM
Delete multiple rows where a blank cell is located kippers Excel Discussion (Misc queries) 2 April 11th 08 11:18 AM
How do I delete blank rows (rows alternate data, blank, data, etc ncochrax Excel Discussion (Misc queries) 2 June 27th 07 04:40 AM
To delete rows when more than one cell is blank [email protected] Excel Worksheet Functions 4 September 27th 06 10:49 PM


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