Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default With all sheets?

I got this working but I want to do this with all sheets in the workbook.

With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
With ActiveSheet
.DisplayPageBreaks = False
StartRow = 2
EndRow = 200
For Lrow = EndRow To StartRow Step -1
If IsError(.Cells(Lrow, "B").Value) Then
'Do nothing, This avoid a error if there is a error in the
cell
ElseIf .Cells(Lrow, "B").Value Like "Sum:*" Then
..Rows(Lrow).Delete
'This will delete each row with the Value 0 in Column M.
End If
Next
End With
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default With all sheets?

DIM WS as Worksheet '''ADD THIS
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
FOR EACH WS in WORKSHEETS '''ADD THIS
WITH WS '''ADD THIS
.DisplayPageBreaks = False
StartRow = 2
EndRow = 200
For Lrow = EndRow To StartRow Step -1
If IsError(.Cells(Lrow, "B").Value) Then
'Do nothing, This avoid a error if there is a error in the
cell
ElseIf .Cells(Lrow, "B").Value Like "Sum:*" Then
..Rows(Lrow).Delete
'This will delete each row with the Value 0 in Column M.
End If
Next
End With
NEXT '''ADD THIS


"Maarkr" wrote:

I got this working but I want to do this with all sheets in the workbook.

With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
With ActiveSheet
.DisplayPageBreaks = False
StartRow = 2
EndRow = 200
For Lrow = EndRow To StartRow Step -1
If IsError(.Cells(Lrow, "B").Value) Then
'Do nothing, This avoid a error if there is a error in the
cell
ElseIf .Cells(Lrow, "B").Value Like "Sum:*" Then
.Rows(Lrow).Delete
'This will delete each row with the Value 0 in Column M.
End If
Next
End With

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default With all sheets?

Hi there Patrick.

Haven't seen you around for a long time, although I don't spend much time in the
programming group.

Hope all is well.

Gord Dibben

On Mon, 24 Mar 2008 06:40:01 -0700, Patrick Molloy
wrote:

DIM WS as Worksheet '''ADD THIS
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
FOR EACH WS in WORKSHEETS '''ADD THIS
WITH WS '''ADD THIS
.DisplayPageBreaks = False
StartRow = 2
EndRow = 200
For Lrow = EndRow To StartRow Step -1
If IsError(.Cells(Lrow, "B").Value) Then
'Do nothing, This avoid a error if there is a error in the
cell
ElseIf .Cells(Lrow, "B").Value Like "Sum:*" Then
.Rows(Lrow).Delete
'This will delete each row with the Value 0 in Column M.
End If
Next
End With
NEXT '''ADD THIS


"Maarkr" wrote:

I got this working but I want to do this with all sheets in the workbook.

With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
With ActiveSheet
.DisplayPageBreaks = False
StartRow = 2
EndRow = 200
For Lrow = EndRow To StartRow Step -1
If IsError(.Cells(Lrow, "B").Value) Then
'Do nothing, This avoid a error if there is a error in the
cell
ElseIf .Cells(Lrow, "B").Value Like "Sum:*" Then
.Rows(Lrow).Delete
'This will delete each row with the Value 0 in Column M.
End If
Next
End With


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
Print sheets by "All Sheets in workbook, EXCEPT for specific named sheets". Possible? Corey Excel Programming 2 December 11th 06 01:35 AM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Programming 6 March 29th 06 12:43 PM
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? StargateFanFromWork[_3_] Excel Programming 6 January 26th 06 06:31 PM
Allocate Files to Sheets and Build a Master Sheet which Summarises All Sheets hanuman Excel Programming 0 September 9th 03 11:23 AM


All times are GMT +1. The time now is 02:00 PM.

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"