PC Review


Reply
Thread Tools Rate Thread

Deleting rows in multiple worksheets

 
 
Elizabeth
Guest
Posts: n/a
 
      31st Oct 2008
I need help in deleting empty rows on multiple worksheets where the empty row
is a different row number on each of the worksheets. I also need to delete
the empty rows at the bottom of the worksheets after the last line of data.
 
Reply With Quote
 
 
 
 
RyanH
Guest
Posts: n/a
 
      31st Oct 2008
> I need help in deleting empty rows on multiple worksheets where the empty
row
> is a different row number on each of the worksheets.


Are you saying you want to delete all empty rows or one specific empty row
each worksheet? If you want to delete one specific row on each worksheet you
will have to have some way of indicating to Excel where to find that row
number. Maybe by using a helper row or a interior color, etc.

>I also need to delete the empty rows at the bottom of the worksheets after the >last line of data.


I'm not quite sure why you want to delete empty rows below the last line.
They are empty, and if you delete them they will still remain there.

--
Cheers,
Ryan


"Elizabeth" wrote:

> I need help in deleting empty rows on multiple worksheets where the empty row
> is a different row number on each of the worksheets. I also need to delete
> the empty rows at the bottom of the worksheets after the last line of data.

 
Reply With Quote
 
Lizz45ie
Guest
Posts: n/a
 
      31st Oct 2008
The rows that I want to delete within the workbooks are colored on each
worksheet but they are a different row in each worksheet.

The rows that I want to delete at the end of the worksheets has information
in them but not all of the cells are completed. They have a #n/a in the
cells where data is missing in the row. Hope that helps.

"RyanH" wrote:

> > I need help in deleting empty rows on multiple worksheets where the empty

> row
> > is a different row number on each of the worksheets.

>
> Are you saying you want to delete all empty rows or one specific empty row
> each worksheet? If you want to delete one specific row on each worksheet you
> will have to have some way of indicating to Excel where to find that row
> number. Maybe by using a helper row or a interior color, etc.
>
> >I also need to delete the empty rows at the bottom of the worksheets after the >last line of data.

>
> I'm not quite sure why you want to delete empty rows below the last line.
> They are empty, and if you delete them they will still remain there.
>
> --
> Cheers,
> Ryan
>
>
> "Elizabeth" wrote:
>
> > I need help in deleting empty rows on multiple worksheets where the empty row
> > is a different row number on each of the worksheets. I also need to delete
> > the empty rows at the bottom of the worksheets after the last line of data.

 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      1st Nov 2008
See if this will do the job. As I understand it, you
have several sheets with blank rows and you want those
blank rows deleted. If you have formulas in those rows
that produce zero length strings ("") then they will not
be deleted. If you want those deleted also, the code
will need to be modified. One other thing, the rows to
be hidden are based on the last row in column A with
data in it. If column A is not equal to the longest row,
the the code will need to be modified. Try it on a copy
before running it on the actual workbook.


Sub delEmpRw()
Dim s As Long, i As Long
For s = 1 To ThisWorkbook.Sheets.Count
With Sheets(s)
lsRw = .Cells(Rows.Count, 1).End(xlUp).Row
For i = lsRw To 2 Step -1 'Assumes Header Row
If WorksheetFunction.CountA(.Range("A" & i & ":" _
& .Cells(i, Columns.Count).End(xlToLeft).Address)) = 0 Then
.Rows(i).Delete
End If
Next
.Rows(Sheets(s).Cells(Rows.Count, 1) _
.End(xlUp).Row + 1 & ":" & Rows.Count).Hidden = True
x = 0
End With
Next
End Sub




"Lizz45ie" wrote:

> The rows that I want to delete within the workbooks are colored on each
> worksheet but they are a different row in each worksheet.
>
> The rows that I want to delete at the end of the worksheets has information
> in them but not all of the cells are completed. They have a #n/a in the
> cells where data is missing in the row. Hope that helps.
>
> "RyanH" wrote:
>
> > > I need help in deleting empty rows on multiple worksheets where the empty

> > row
> > > is a different row number on each of the worksheets.

> >
> > Are you saying you want to delete all empty rows or one specific empty row
> > each worksheet? If you want to delete one specific row on each worksheet you
> > will have to have some way of indicating to Excel where to find that row
> > number. Maybe by using a helper row or a interior color, etc.
> >
> > >I also need to delete the empty rows at the bottom of the worksheets after the >last line of data.

> >
> > I'm not quite sure why you want to delete empty rows below the last line.
> > They are empty, and if you delete them they will still remain there.
> >
> > --
> > Cheers,
> > Ryan
> >
> >
> > "Elizabeth" wrote:
> >
> > > I need help in deleting empty rows on multiple worksheets where the empty row
> > > is a different row number on each of the worksheets. I also need to delete
> > > the empty rows at the bottom of the worksheets after the last line of data.

 
Reply With Quote
 
RyanH
Guest
Posts: n/a
 
      1st Nov 2008
I need to get a few specifics before I can write code for your application.

1.) So you want to delete all colored rows and all worksheets? Do you want
to delete only certain colored rows? Please be specific.

2.) You want to delete all rows that are totally empty, rows that contain
#N/A, or all rows after a certain cell in a particular column. Please be
specific.
--
Cheers,
Ryan


"Lizz45ie" wrote:

> The rows that I want to delete within the workbooks are colored on each
> worksheet but they are a different row in each worksheet.
>
> The rows that I want to delete at the end of the worksheets has information
> in them but not all of the cells are completed. They have a #n/a in the
> cells where data is missing in the row. Hope that helps.
>
> "RyanH" wrote:
>
> > > I need help in deleting empty rows on multiple worksheets where the empty

> > row
> > > is a different row number on each of the worksheets.

> >
> > Are you saying you want to delete all empty rows or one specific empty row
> > each worksheet? If you want to delete one specific row on each worksheet you
> > will have to have some way of indicating to Excel where to find that row
> > number. Maybe by using a helper row or a interior color, etc.
> >
> > >I also need to delete the empty rows at the bottom of the worksheets after the >last line of data.

> >
> > I'm not quite sure why you want to delete empty rows below the last line.
> > They are empty, and if you delete them they will still remain there.
> >
> > --
> > Cheers,
> > Ryan
> >
> >
> > "Elizabeth" wrote:
> >
> > > I need help in deleting empty rows on multiple worksheets where the empty row
> > > is a different row number on each of the worksheets. I also need to delete
> > > the empty rows at the bottom of the worksheets after the last line of data.

 
Reply With Quote
 
Lizz45ie
Guest
Posts: n/a
 
      11th Nov 2008
1. I want to delete all colored rows if they are empty.
2. Delete all rows at the bottom of the worksheet if column "R" is empty.
Columns A - O contains formulas that are used in other parts of the worksheet.

"RyanH" wrote:

> I need to get a few specifics before I can write code for your application.
>
> 1.) So you want to delete all colored rows and all worksheets? Do you want
> to delete only certain colored rows? Please be specific.
>
> 2.) You want to delete all rows that are totally empty, rows that contain
> #N/A, or all rows after a certain cell in a particular column. Please be
> specific.
> --
> Cheers,
> Ryan
>
>
> "Lizz45ie" wrote:
>
> > The rows that I want to delete within the workbooks are colored on each
> > worksheet but they are a different row in each worksheet.
> >
> > The rows that I want to delete at the end of the worksheets has information
> > in them but not all of the cells are completed. They have a #n/a in the
> > cells where data is missing in the row. Hope that helps.
> >
> > "RyanH" wrote:
> >
> > > > I need help in deleting empty rows on multiple worksheets where the empty
> > > row
> > > > is a different row number on each of the worksheets.
> > >
> > > Are you saying you want to delete all empty rows or one specific empty row
> > > each worksheet? If you want to delete one specific row on each worksheet you
> > > will have to have some way of indicating to Excel where to find that row
> > > number. Maybe by using a helper row or a interior color, etc.
> > >
> > > >I also need to delete the empty rows at the bottom of the worksheets after the >last line of data.
> > >
> > > I'm not quite sure why you want to delete empty rows below the last line.
> > > They are empty, and if you delete them they will still remain there.
> > >
> > > --
> > > Cheers,
> > > Ryan
> > >
> > >
> > > "Elizabeth" wrote:
> > >
> > > > I need help in deleting empty rows on multiple worksheets where the empty row
> > > > is a different row number on each of the worksheets. I also need to delete
> > > > the empty rows at the bottom of the worksheets after the last line of data.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting Rows across Several Worksheets if Value = 0 PVANS Microsoft Excel Programming 2 11th Aug 2009 11:34 AM
Inserting/deleting rows between worksheets =?Utf-8?B?S2xlZQ==?= Microsoft Excel Worksheet Functions 4 22nd Jul 2007 07:41 PM
deleting rows across worksheets? =?Utf-8?B?ZHIgY2h1Y2s=?= Microsoft Excel Programming 2 8th Nov 2006 03:58 PM
Copying multiple rows to other worksheets (but amount of rows varies) - How? David Smithz Microsoft Excel Misc 1 18th Jun 2006 04:31 PM
Deleting a rows from multiple worksheets =?Utf-8?B?U2Nob29sIFRlYWNoZXI=?= Microsoft Excel Worksheet Functions 0 6th Jul 2005 06:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:28 PM.