ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete rows with nothing in Column B (https://www.excelbanter.com/excel-programming/351870-delete-rows-nothing-column-b.html)

marlea[_12_]

Delete rows with nothing in Column B
 

I searched and found a lot of posts on Deleting, but I'm still stuck
There are 900+ rows in my table. Beginning with row 18, I'd like
macro to find the end of the table, identify which rows have nothing i
Colulmn B, and then delete all of those rows. Can anyone help? Than
you

--
marle
-----------------------------------------------------------------------
marlea's Profile: http://www.excelforum.com/member.php...fo&userid=2620
View this thread: http://www.excelforum.com/showthread.php?threadid=50658


Norman Jones

Delete rows with nothing in Column B
 
Hi Marlea,

Try:

'=============
Public Sub Tester()
Dim LRow As Long

LRow = Cells(Rows.Count, "B").End(xlUp)

On Error Resume Next
Range("B18:B" & LRow). _
SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0


End Sub
'<<=============


---
Regards,
Norman



"marlea" wrote in
message ...

I searched and found a lot of posts on Deleting, but I'm still stuck.
There are 900+ rows in my table. Beginning with row 18, I'd like a
macro to find the end of the table, identify which rows have nothing in
Colulmn B, and then delete all of those rows. Can anyone help? Thank
you.


--
marlea
------------------------------------------------------------------------
marlea's Profile:
http://www.excelforum.com/member.php...o&userid=26209
View this thread: http://www.excelforum.com/showthread...hreadid=506585




Norman Jones

Delete rows with nothing in Column B
 
Hi Marlea,

LRow = Cells(Rows.Count, "B").End(xlUp)


Should read:

LRow = Cells(Rows.Count, "B").End(xlUp).Row



---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Marlea,

Try:

'=============
Public Sub Tester()
Dim LRow As Long

LRow = Cells(Rows.Count, "B").End(xlUp)

On Error Resume Next
Range("B18:B" & LRow). _
SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0


End Sub
'<<=============


---
Regards,
Norman




marlea[_13_]

Delete rows with nothing in Column B
 

Norman, this is fantastic. Thank you so much

--
marle
-----------------------------------------------------------------------
marlea's Profile: http://www.excelforum.com/member.php...fo&userid=2620
View this thread: http://www.excelforum.com/showthread.php?threadid=50658



All times are GMT +1. The time now is 12:31 AM.

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