Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
deleting blank rows | New Users to Excel | |||
Deleting Blank Rows. | Excel Discussion (Misc queries) | |||
Deleting blank rows | Excel Worksheet Functions | |||
Deleting Blank Rows | New Users to Excel | |||
Deleting rows with blank cells | Excel Worksheet Functions |