ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Removing Blank Rows in an excel spreadsheet (https://www.excelbanter.com/excel-discussion-misc-queries/214034-removing-blank-rows-excel-spreadsheet.html)

Phyllis

Removing Blank Rows in an excel spreadsheet
 
I have a spreadsheet that contains blank row to separate data, I need to
remove all the blank rows in order to resort the data for creating labels.

jlclyde

Removing Blank Rows in an excel spreadsheet
 
On Dec 17, 4:08*pm, Phyllis wrote:
I have a spreadsheet that contains blank row to separate data, I need to
remove all the blank rows in order to resort the data for creating labels..


Are you asking how to remove the blank rows? cause you can just sort
the sheet and the blank rows will go to the bottom. If you are
wondering how to sort the sheet and then put the rows back in, then
that is a little trickier.

Jay

Chip Pearson

Removing Blank Rows in an excel spreadsheet
 
You can do it with simple code:

Sub RemoveBlankRows()
Dim WS As Worksheet
Dim RNdx As Long
Dim LastRow As Long

Set WS = Worksheets("Sheet1")
With WS
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With

For RNdx = LastRow To 1 Step -1
If Application.CountA(WS.Rows(RNdx)) = 0 Then
WS.Rows(RNdx).Delete
End If
Next RNdx
End Sub

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Wed, 17 Dec 2008 14:08:01 -0800, Phyllis
wrote:

I have a spreadsheet that contains blank row to separate data, I need to
remove all the blank rows in order to resort the data for creating labels.


Phyllis

Removing Blank Rows in an excel spreadsheet
 
Thank you so much! Worked like a charm!

"Chip Pearson" wrote:

You can do it with simple code:

Sub RemoveBlankRows()
Dim WS As Worksheet
Dim RNdx As Long
Dim LastRow As Long

Set WS = Worksheets("Sheet1")
With WS
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With

For RNdx = LastRow To 1 Step -1
If Application.CountA(WS.Rows(RNdx)) = 0 Then
WS.Rows(RNdx).Delete
End If
Next RNdx
End Sub

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Wed, 17 Dec 2008 14:08:01 -0800, Phyllis
wrote:

I have a spreadsheet that contains blank row to separate data, I need to
remove all the blank rows in order to resort the data for creating labels.



Phyllis

Removing Blank Rows in an excel spreadsheet
 
I wish it was that easy, I tried that first, but thank you.

"jlclyde" wrote:

On Dec 17, 4:08 pm, Phyllis wrote:
I have a spreadsheet that contains blank row to separate data, I need to
remove all the blank rows in order to resort the data for creating labels..


Are you asking how to remove the blank rows? cause you can just sort
the sheet and the blank rows will go to the bottom. If you are
wondering how to sort the sheet and then put the rows back in, then
that is a little trickier.

Jay


Gord Dibben

Removing Blank Rows in an excel spreadsheet
 
Select a column with the blank rows.

F5SpecialBlanksOK

EditDeleteEntire Row


Gord Dibben MS Excel MVP

On Wed, 17 Dec 2008 14:08:01 -0800, Phyllis
wrote:

I have a spreadsheet that contains blank row to separate data, I need to
remove all the blank rows in order to resort the data for creating labels.




All times are GMT +1. The time now is 08:35 PM.

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