ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete rows ere first cell is blank but ohters celld have data? (https://www.excelbanter.com/excel-programming/368267-delete-rows-ere-first-cell-blank-but-ohters-celld-have-data.html)

Mascot

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

skatonni via OfficeKB.com

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


All times are GMT +1. The time now is 03:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com