SEARCH EXCEL ARRAY FOR NON-VOIDS AND ENTER INTO ANOTHER ARRAY,

R

ROSE THE RED

I HAVE A WOORKSHEET THAT HAS WHOLE ROWS WITH SPACES IN BETWEEN SOME ROWS WITH
DATA. ON ANOTHER WOORSHEET I WANT TO JUST HAVE THOSE ROWS THAT CONTAIN DATA.
THE ORIGINAL CANNOT CHANGE. THANKS.
 
P

Patrick Molloy

Run the following code.Th eassumption is that if a cell in column A is empty,
then the entire row can be deleted...

Option Explicit

Sub RemoveBlankRows()

Dim col As Range
Set col = Range("A:A")

Set col = col.SpecialCells(xlCellTypeBlanks)
If Not col Is Nothing Then
col.EntireRow.Delete
End If

End Sub


Patrick Molloy
Microsoft Excel MVP
 

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