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: 3
Default Only works on One Worksheet, When Looping thru All WS

I am trying to get the operations listed inside the first
For loop to work on each Worksheet as it goes thru each
one. I know it steps thru them, I've used a msgbox to
show each ones name. But it will only perform the
requested operations on ONE worksheet. What am I doing
wrong? Thx for your help - Dean



Sub DeleteAllNoneDataRowsx()
'This will only work on One Tab at a time
'
Dim wks As Worksheet
Dim r As Integer
For Each wks In Worksheets
LastRow = ActiveSheet.UsedRange.Row - 1 +
ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For r = LastRow To 1 Step -1
If Application.WorksheetFunction.CountA
(Rows(r)) = 0 _
Then Rows(r).Delete Else
If ActiveSheet.Cells(r, 15).Value
= "Total" _
Then Rows(r).Delete Else
If ActiveSheet.Cells(r, 15).Value
= "Value" _
Then Rows(r).Delete Else
If ActiveSheet.Cells(r, 15).Value = "" _
Then Rows(r).Delete
Next r
Next wks
End Sub
 
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
Looping through charts in a worksheet Grant Excel Programming 1 August 6th 04 09:22 AM
Looping through ComboBoxes in a worksheet TonyM Excel Programming 2 May 18th 04 01:48 PM
Looping checkboxes embedded in worksheet Theresa[_5_] Excel Programming 1 February 27th 04 04:41 AM
Looping down list and each time copying to another worksheet mattri Excel Programming 2 February 16th 04 06:26 PM
building a text string while looping though a worksheet Phillips Excel Programming 4 December 10th 03 08:31 AM


All times are GMT +1. The time now is 09:31 AM.

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"