Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete rows if they are empty

Hi Guys,

I have the following structure of a table (see attachment).
As you can see some rows are completly empty.
Want I would like to do now is delete these rows if they are empty by
using a macro.

File Attached: http://www.excelforum.com/attachment.php?postid=317210 (example.xls)

------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Delete rows if they are empty

The easiest way its to record a macro and than edit it for future use.
The steps to take for your code:

1. Select a column.
2. Edit Go To Special Blanks
3. Delete Rows

--
sb
"chrismania" wrote in message
...
Hi Guys,

I have the following structure of a table (see attachment).
As you can see some rows are completly empty.
Want I would like to do now is delete these rows if they are empty by
using a macro.

File Attached: http://www.excelforum.com/attachment.php?postid=317210

(example.xls)

------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Delete rows if they are empty

Your attachment is not visible outside the excelforum.

Best to explain your problem in your posting.

Sub DeleteEmptyRows()
Dim rng as Range
Dim cell as Range
Dim rng1 as Range
set rng = Range(cells(1,1),cells(rows.count,1).End(xlup))
for each cell in rng
if application.CountA(cell.EntireRow) = 0 then
if rng1 is nothing then
set rng1 = cell
else
set rng1 = union(rng1,cell)
end if
end if
Next
if not rng1 is nothing then
rng1.EntireRow.Delete
End if
End Sub

Would be my guess

--
Regards,
Tom Ogilvy

chrismania wrote in message
...
Hi Guys,

I have the following structure of a table (see attachment).
As you can see some rows are completly empty.
Want I would like to do now is delete these rows if they are empty by
using a macro.

File Attached: http://www.excelforum.com/attachment.php?postid=317210

(example.xls)

------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



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 empty rows aditya Excel Discussion (Misc queries) 1 June 3rd 09 12:58 PM
Delete Empty Rows JCG Excel Discussion (Misc queries) 4 December 18th 07 11:31 AM
How to Delete empty rows in excel in b/w rows with values Dennis Excel Worksheet Functions 3 August 28th 07 04:15 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


All times are GMT +1. The time now is 10:17 PM.

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

About Us

"It's about Microsoft Excel"