Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

With all sheets?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Maarkr - 24 Mar 2008 14:26 GMT
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
Patrick Molloy - 24 Mar 2008 14:40 GMT
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

> I got this working but I want to do this with all sheets in the workbook.
>
[quoted text clipped - 17 lines]
>         Next
>     End With
Gord Dibben - 25 Mar 2008 05:35 GMT
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

>DIM WS as Worksheet   '''ADD THIS
>With Application
[quoted text clipped - 40 lines]
>>         Next
>>     End With
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.