Remove all empty rows in a worksheet

T

Tom Ogilvy

Assume if the cell in column A is empty, then the row should be removed

Dim rng as Range
On Error Resume Next
set rng = ActiveSheet.Columns(1).SpecialCells(xlBlanks)
On Error goto 0
if not rng is nothing then
rng.EntireRow.Delete
End if
 
W

wrangler

Tom said:
Assume if the cell in column A is empty, then the row should be removed

Dim rng as Range
On Error Resume Next
set rng = ActiveSheet.Columns(1).SpecialCells(xlBlanks)
On Error goto 0
if not rng is nothing then
rng.EntireRow.Delete
End if

--
Regards,
Tom Ogilvy


"wrangler" <[email protected]
wrote in
message news:[email protected]...
*-is there a way in VBA to remove all empty rows in a worksheet
'Sheet1'?-*


+-------------------------------------------------------------------+
|Filename: Remove all empty rows in a worksheet.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4326 |

+-------------------------------------------------------------------+

Thank you for replying and I appreciate your effort, but your VBA do
not fit my Requirement, If you Please Refer to the attachment File, yo
will be aple to see my Dilemma.

wrangler

Thank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top