Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Remove all empty rows in a worksheet


*-is there a way in VBA to remove all empty rows in a worksheet
'Sheet1'?-*


+-------------------------------------------------------------------+
|Filename: Remove all empty rows in a worksheet.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4326 |
+-------------------------------------------------------------------+

--
wrangler
------------------------------------------------------------------------
wrangler's Profile: http://www.excelforum.com/member.php...o&userid=31048
View this thread: http://www.excelforum.com/showthread...hreadid=508980

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Remove all empty rows in a worksheet

Assume if the cell in column A is empty, then the row should be removed

Dim rng as Range
On Error Resume Next
set rng = ActiveSheet.Columns(1).SpecialCells(xlBlanks)
On Error goto 0
if not rng is nothing then
rng.EntireRow.Delete
End if

--
Regards,
Tom Ogilvy


"wrangler" wrote in
message ...

*-is there a way in VBA to remove all empty rows in a worksheet
'Sheet1'?-*


+-------------------------------------------------------------------+
|Filename: Remove all empty rows in a worksheet.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4326 |
+-------------------------------------------------------------------+

--
wrangler
------------------------------------------------------------------------
wrangler's Profile:

http://www.excelforum.com/member.php...o&userid=31048
View this thread: http://www.excelforum.com/showthread...hreadid=508980



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Remove all empty rows in a worksheet


Tom Ogilvy Wrote:
Assume if the cell in column A is empty, then the row should be removed

Dim rng as Range
On Error Resume Next
set rng = ActiveSheet.Columns(1).SpecialCells(xlBlanks)
On Error goto 0
if not rng is nothing then
rng.EntireRow.Delete
End if

--
Regards,
Tom Ogilvy


"wrangler"
wrote in
message ...

*-is there a way in VBA to remove all empty rows in a worksheet
'Sheet1'?-*



+-------------------------------------------------------------------+
|Filename: Remove all empty rows in a worksheet.zip

|
|Download: http://www.excelforum.com/attachment.php?postid=4326

|

+-------------------------------------------------------------------+

--
wrangler


------------------------------------------------------------------------
wrangler's Profile:

http://www.excelforum.com/member.php...o&userid=31048
View this thread

http://www.excelforum.com/showthread...hreadid=508980


Thank you for replying and I appreciate your effort, but your VBA do
not fit my Requirement, If you Please Refer to the attachment File, yo
will be aple to see my Dilemma.

wrangler

Thank

--
wrangle
-----------------------------------------------------------------------
wrangler's Profile: http://www.excelforum.com/member.php...fo&userid=3104
View this thread: http://www.excelforum.com/showthread.php?threadid=50898

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
How do I remove 10,000+ empty rows below my table? Frustrated Excel User[_2_] Excel Discussion (Misc queries) 8 April 14th 23 05:34 PM
how to remove empty rows? Joe Excel Discussion (Misc queries) 2 January 6th 08 05:10 PM
How do I remove empty Rows Rodders Excel Discussion (Misc queries) 2 January 12th 07 12:04 PM
VBA - remove all empty rows in a worksheet juergenkemeter[_5_] Excel Programming 15 January 14th 06 01:13 AM
Remove empty rows Kaj Pedersen Excel Programming 15 November 2nd 03 07:22 PM


All times are GMT +1. The time now is 06:13 PM.

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"