Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete empty rows from a sheet
Hey could anybody help me with a script for deleting a row from a sheet if its second column is empty? I would appreciate it, Ben -- bm4466 ------------------------------------------------------------------------ bm4466's Profile: http://www.excelforum.com/member.php...o&userid=33949 View this thread: http://www.excelforum.com/showthread...hreadid=548594 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete empty rows from a sheet
Hi bm4466
Try http://www.rondebruin.nl/specialcells.htm Sub DeleteBlankRows_2() 'This macro delete all rows with a blank cell in column B 'If there are no blanks or there are too many areas you see a MsgBox Dim CCount As Long On Error Resume Next With Columns("B") ' You can also use a range like this Range("A1:A8000") CCount = .SpecialCells(xlCellTypeBlanks).Areas(1).Cells.Cou nt If CCount = 0 Then MsgBox "There are no blank cells" ElseIf CCount = .Cells.Count Then MsgBox "There are more then 8192 areas" Else .SpecialCells(xlCellTypeBlanks).EntireRow.Delete End If End With On Error GoTo 0 End Sub -- Regards Ron De Bruin http://www.rondebruin.nl "bm4466" wrote in message ... Hey could anybody help me with a script for deleting a row from a sheet if its second column is empty? I would appreciate it, Ben -- bm4466 ------------------------------------------------------------------------ bm4466's Profile: http://www.excelforum.com/member.php...o&userid=33949 View this thread: http://www.excelforum.com/showthread...hreadid=548594 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete empty rows from a sheet
rnum = 'insert start row number here Range("A" & rnum).select while activecell <"" do if activecell.offset(0,1) = "" then entirerow.delete else rnum = rnum + 1 end if Range("A" & rnum).select loop until activecell = "" Wend bm4466 Wrote: Hey could anybody help me with a script for deleting a row from a sheet if its second column is empty? I would appreciate it, Ben -- pianoman ------------------------------------------------------------------------ pianoman's Profile: http://www.excelforum.com/member.php...o&userid=33712 View this thread: http://www.excelforum.com/showthread...hreadid=548594 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hpw do I delete multiple empty rows found between filled rows? | Excel Worksheet Functions | |||
How to Delete empty rows in excel in b/w rows with values | Excel Worksheet Functions | |||
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows | Excel Worksheet Functions | |||
delete empty rows of a sheet | Excel Programming | |||
Delete empty rows. | Excel Programming |