Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default How do I remove LOTS of blank rows at once

Is there a way to delete 100's of blank rows programatically ?
--
BB
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default How do I remove LOTS of blank rows at once

Hi,

Right click your sheet tab, view code and paste this in and run it

Sub Kill_Blank_Rows()
Dim i As Long
For i = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
If WorksheetFunction.CountA(ActiveSheet.UsedRange.Row s(i)) = 0 Then
ActiveSheet.UsedRange.Rows(i).EntireRow.Delete
End If
Next i
End Sub

Mike

"brewster56" wrote:

Is there a way to delete 100's of blank rows programatically ?
--
BB

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default How do I remove LOTS of blank rows at once


Worksheets("Sheet1").Rows(StartRowNumber).Resize(N umberOfRows).Delete

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


On Wed, 26 Nov 2008 13:51:00 -0800, brewster56
wrote:

Is there a way to delete 100's of blank rows programatically ?

  #4   Report Post  
Posted to microsoft.public.excel.misc
AJB AJB is offline
external usenet poster
 
Posts: 40
Default How do I remove LOTS of blank rows at once

ASAP utilities is an free add-in that has a tool to delete blank rows and
columns

"brewster56" wrote:

Is there a way to delete 100's of blank rows programatically ?
--
BB

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default How do I remove LOTS of blank rows at once

You are awesome - thank you very much both for the quick reply (saved my day)
and the fact that it worked first time and solved my problem
--
BB


"Mike H" wrote:

Hi,

Right click your sheet tab, view code and paste this in and run it

Sub Kill_Blank_Rows()
Dim i As Long
For i = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
If WorksheetFunction.CountA(ActiveSheet.UsedRange.Row s(i)) = 0 Then
ActiveSheet.UsedRange.Rows(i).EntireRow.Delete
End If
Next i
End Sub

Mike

"brewster56" wrote:

Is there a way to delete 100's of blank rows programatically ?
--
BB



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default How do I remove LOTS of blank rows at once

Glad I could help

"brewster56" wrote:

You are awesome - thank you very much both for the quick reply (saved my day)
and the fact that it worked first time and solved my problem
--
BB


"Mike H" wrote:

Hi,

Right click your sheet tab, view code and paste this in and run it

Sub Kill_Blank_Rows()
Dim i As Long
For i = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
If WorksheetFunction.CountA(ActiveSheet.UsedRange.Row s(i)) = 0 Then
ActiveSheet.UsedRange.Rows(i).EntireRow.Delete
End If
Next i
End Sub

Mike

"brewster56" wrote:

Is there a way to delete 100's of blank rows programatically ?
--
BB

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default How do I remove LOTS of blank rows at once

Hi:

I copied it into view code, but i can't figure out how to "run it." can you
tell me how please?

thanks.

Jeff

"Mike H" wrote:

Hi,

Right click your sheet tab, view code and paste this in and run it

Sub Kill_Blank_Rows()
Dim i As Long
For i = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
If WorksheetFunction.CountA(ActiveSheet.UsedRange.Row s(i)) = 0 Then
ActiveSheet.UsedRange.Rows(i).EntireRow.Delete
End If
Next i
End Sub

Mike

"brewster56" wrote:

Is there a way to delete 100's of blank rows programatically ?
--
BB

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default How do I remove LOTS of blank rows at once

You should NOT start a new thread. Stay in the old one. Here's another you
may prefer IF the blanks are col A
Sub DeleteBlanks()
Columns("A").SpecialCells(xlCellTypeBlanks).Entire Row.Delete
End Sub
If you're new to macros, you may want to read David McRitchie's intro
at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"jeffc4442" wrote in message
...
Hi:

I copied it into view code, but i can't figure out how to "run it." can
you
tell me how please?

thanks.

Jeff

"Mike H" wrote:

Hi,

Right click your sheet tab, view code and paste this in and run it

Sub Kill_Blank_Rows()
Dim i As Long
For i = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
If WorksheetFunction.CountA(ActiveSheet.UsedRange.Row s(i)) = 0 Then
ActiveSheet.UsedRange.Rows(i).EntireRow.Delete
End If
Next i
End Sub

Mike

"brewster56" wrote:

Is there a way to delete 100's of blank rows programatically ?
--
BB


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
gang remove blank rows swell estimator[_2_] Excel Discussion (Misc queries) 13 September 15th 08 11:37 PM
Remove Blank and Non Data Rows UT Excel Discussion (Misc queries) 3 June 12th 07 10:01 PM
formula to remove blank rows Bryan Excel Discussion (Misc queries) 1 January 25th 06 03:52 PM
remove or hide blank rows Erik Beijlen via OfficeKB.com Excel Discussion (Misc queries) 1 February 1st 05 01:17 PM
How do I remove blank rows in Excel? m28leics Excel Discussion (Misc queries) 2 November 29th 04 11:56 PM


All times are GMT +1. The time now is 02:34 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"