LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Help with Chip Pearson's Code for Deleting Blank Rows

Hello All,
I have obtained the following macros from Chip Pearson's Website which
deletes BlankRows.... and it is excellent.

Public Sub DeleteBlankRows()'chip PearsonDim R As LongDim C As RangeDim N As
LongDim rng As Range On Error GoTo EndMacroApplication.ScreenUpdating =
FalseApplication.Calculation = xlCalculationManual If Selection.Rows.Count
1 Then Set rng = SelectionElse Set rng = ActiveSheet.UsedRange.RowsEnd
IfN = 0For R = rng.Rows.Count To 1 Step -1 If
Application.WorksheetFunction.CountA(rng.Rows(R).E ntireRow) = 0 Then
rng.Rows(R).EntireRow.Delete N = N + 1 End IfNext
REndMacro:Application.ScreenUpdating = TrueApplication.Calculation =
xlCalculationAutomaticEnd Sub
But I wish it to run the above macro on all the Sheets in my Workbook.
Somethin like.
For z = 1 To Sheets.Count
' Sheets(z).Activate
' do Row Deleting here
'Next

But I have failed in all experiments.. Can somebody suggest a way of how to
implement Chip Pearson's macro to run on all the Worksheets in the Workbook


 
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
Need Help Deleting Blank Rows JCG Excel Worksheet Functions 3 February 22nd 10 04:53 PM
deleting blank rows KRK New Users to Excel 3 June 27th 09 12:51 PM
Chip Pearson's NewWorkDays formula Pete Rooney Excel Discussion (Misc queries) 9 August 9th 08 01:57 AM
Chip Pearson's Forum Etiquette Gary L Brown New Users to Excel 0 January 20th 06 07:22 PM
Deleting ALL duplicates using Pearson's code [email protected] Excel Worksheet Functions 2 May 6th 05 01:50 PM


All times are GMT +1. The time now is 12:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"