Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Delete empty rows in list of data

I want to delete empty rows in a data list by macro.

Which is the simplest method of doing this


--
Charlie New XP User
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Delete empty rows in list of data

One way is to sort the list. Empty rows end up at the top or bottom
depending on which way you sort.

--

Rod Gill


"sswcharlie1" wrote in message
...
I want to delete empty rows in a data list by macro.

Which is the simplest method of doing this


--
Charlie New XP User



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Delete empty rows in list of data

Unfortunately the data is in groups and I would mix up the data that I want
to extract by a macro.

Charlie
--
Charlie New XP User


"Rod Gill" wrote:

One way is to sort the list. Empty rows end up at the top or bottom
depending on which way you sort.

--

Rod Gill


"sswcharlie1" wrote in message
...
I want to delete empty rows in a data list by macro.

Which is the simplest method of doing this


--
Charlie New XP User




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Delete empty rows in list of data

Have a look here,
Think it may assist you:

http://www.ozgrid.com/VBA/VBACode.htm

Corey....
"sswcharlie1" wrote in message
...
Unfortunately the data is in groups and I would mix up the data that I
want
to extract by a macro.

Charlie
--
Charlie New XP User


"Rod Gill" wrote:

One way is to sort the list. Empty rows end up at the top or bottom
depending on which way you sort.

--

Rod Gill


"sswcharlie1" wrote in message
...
I want to delete empty rows in a data list by macro.

Which is the simplest method of doing this


--
Charlie New XP User






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Delete empty rows in list of data

The following uses column A to determine the depth of the data, and scan all
rows from the bottom to top, removing rows where every column in that row is
empty. If cells contain spaces then this will not work. So use version 2
below.

Sub exempty()
Dim xlr As Long, xr As Long
xlr = Cells(Rows.Count, 1).End(xlUp).Row
For xr = xlr To 1 Step -1
If Application.WorksheetFunction.CountA(Rows(xr)) = 0 Then
Rows(xr).EntireRow.Delete
Next xr
End Sub

' code if cells might contain spaces which should be ignored
Sub exempty2()
Dim xlr As Long, xr As Long, xlDelete As Boolean, xc As Integer
xlr = Cells(Rows.Count, 1).End(xlUp).Row
For xr = xlr To 1 Step -1
xlDelete = True
For xc = 1 To 256
If Len(Trim(Cells(xr, xc))) 0 Then
xlDelete = False
Exit For
End If
Next xc
If xlDelete Then Rows(xr).EntireRow.Delete
Next xr
End Sub

--
Cheers
Nigel



"sswcharlie1" wrote in message
...
I want to delete empty rows in a data list by macro.

Which is the simplest method of doing this


--
Charlie New XP User





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Delete empty rows in list of data



"sswcharlie1" wrote:

I want to delete empty rows in a data list by macro.
Sub cleanline()

Dim rg As Range, rgBlank As Range

Set rg = ActiveSheet.Range("A:A")

On Error Resume Next
Set rgBlank = rg.SpecialCells(xlCellTypeBlanks)
On Error GoTo 0

If rgBlank Is Nothing Then 'no blank cell
MsgBox "No Blank cells found"
Else 'else delete entire rows
rgBlank.EntireRow.Delete
End If
End Sub
Which is the simplest method of doing this


--
Charlie New XP User

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hpw do I delete multiple empty rows found between filled rows? Bill Excel Worksheet Functions 2 November 15th 09 07:12 PM
delete rows with empty cells throughout the data rutski Excel Worksheet Functions 4 November 16th 07 04:24 PM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Excel Worksheet Functions 0 December 13th 06 01:25 AM
Delete Rows with Empty Cells with empty column 1 Scott Excel Programming 5 October 2nd 06 11:57 PM
Find last row of data and delete empty rows Pat Excel Programming 3 February 17th 05 12:34 AM


All times are GMT +1. The time now is 09:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"