PC Review


Reply
Thread Tools Rate Thread

With all sheets?

 
 
Maarkr
Guest
Posts: n/a
 
      24th Mar 2008
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 With Quote
 
 
 
 
Patrick Molloy
Guest
Posts: n/a
 
      24th Mar 2008
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 With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      25th Mar 2008
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
<(E-Mail Removed)> 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 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
Needle in a haystack...searching for VBA code in all Excel sheets orfinding xls users of xla sheets.... CodeMonkey Microsoft Excel Programming 1 28th May 2008 06:10 PM
Print sheets by "All Sheets in workbook, EXCEPT for specific named sheets". Possible? Corey Microsoft Excel Programming 2 11th Dec 2006 01:35 AM
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA Amaxwell Microsoft Excel Worksheet Functions 4 17th Aug 2006 06:23 AM
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? StargateFanFromWork Microsoft Excel Programming 6 26th Jan 2006 06:31 PM
Allocate Files to Sheets and Build a Master Sheet which Summarises All Sheets hanuman Microsoft Excel Programming 0 9th Sep 2003 11:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:21 AM.