ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SEARCH EXCEL ARRAY FOR NON-VOIDS AND ENTER INTO ANOTHER ARRAY, (https://www.excelbanter.com/excel-programming/319885-search-excel-array-non-voids-enter-into-another-array.html)

ROSE THE RED

SEARCH EXCEL ARRAY FOR NON-VOIDS AND ENTER INTO ANOTHER ARRAY,
 
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.

Patrick Molloy[_2_]

SEARCH EXCEL ARRAY FOR NON-VOIDS AND ENTER INTO ANOTHER ARRAY,
 
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

"ROSE THE RED" wrote:

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.



All times are GMT +1. The time now is 04:37 AM.

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