Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JCG JCG is offline
external usenet poster
 
Posts: 6
Default Need Help Deleting Blank Rows

Greetings:

I have a spread sheet with data that has multiple blank rows that I would
like to delete with a macro. Each row of data is different with columns that
may or may not be blank. Therefore, I cannot search on a specific column to
delete the row. Any help is appreciated.
--
Thanks in advance...j
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,203
Default Need Help Deleting Blank Rows

We need some kind of rule to follow to decide if a row is considered 'blank'
or not. If not a single column, then perhaps empty cells in any one of
several different colums, as
if a4 is empty, or g4 is empty or i4 is empty, then delete row 4 completely,
or
a combination of columns, as
If a4 and i4 are empty, or g4 and k4 are empty, then delete row 4 completely.


"JCG" wrote:

Greetings:

I have a spread sheet with data that has multiple blank rows that I would
like to delete with a macro. Each row of data is different with columns that
may or may not be blank. Therefore, I cannot search on a specific column to
delete the row. Any help is appreciated.
--
Thanks in advance...j

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JCG JCG is offline
external usenet poster
 
Posts: 6
Default Need Help Deleting Blank Rows

Thanks for responding. The rule that will work with this spread sheet data
is "If there is NO data in columns A through AC, consider the row blank and
delete it" Can this be done? Thanks again...j
--
Thanks in advance...j


"JLatham" wrote:

We need some kind of rule to follow to decide if a row is considered 'blank'
or not. If not a single column, then perhaps empty cells in any one of
several different colums, as
if a4 is empty, or g4 is empty or i4 is empty, then delete row 4 completely,
or
a combination of columns, as
If a4 and i4 are empty, or g4 and k4 are empty, then delete row 4 completely.


"JCG" wrote:

Greetings:

I have a spread sheet with data that has multiple blank rows that I would
like to delete with a macro. Each row of data is different with columns that
may or may not be blank. Therefore, I cannot search on a specific column to
delete the row. Any help is appreciated.
--
Thanks in advance...j

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Need Help Deleting Blank Rows

Sub DeleteRows_If_A_to_AC_MT()
Dim lRow As Long
Dim StartRow As Long
Dim EndRow As Long
StartRow = 1

EndRow = Cells(Rows.Count, 1).End(xlUp).Row

'EndRow = 1000

For lRow = EndRow To StartRow Step -1

If Application.CountA(Range(Cells(lRow, "A"), _
Cells(lRow, "AC"))) = 0 Then
Rows(lRow).Delete
End If
Next

End Sub


Gord Dibben MS Excel MVP

On Mon, 22 Feb 2010 07:36:01 -0800, JCG
wrote:

Thanks for responding. The rule that will work with this spread sheet data
is "If there is NO data in columns A through AC, consider the row blank and
delete it" Can this be done? Thanks again...j


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
deleting blank rows KRK New Users to Excel 3 June 27th 09 12:51 PM
Deleting Blank Rows. GEM Excel Discussion (Misc queries) 3 April 15th 09 04:18 PM
Deleting blank rows Yvette Excel Worksheet Functions 3 June 9th 06 10:30 AM
Deleting Blank Rows Reeni New Users to Excel 4 December 15th 05 01:56 AM
Deleting rows with blank cells Batman Excel Worksheet Functions 10 February 16th 05 06:01 PM


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