Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Looping through charts in a worksheet | Excel Programming | |||
Looping through ComboBoxes in a worksheet | Excel Programming | |||
Looping checkboxes embedded in worksheet | Excel Programming | |||
Looping down list and each time copying to another worksheet | Excel Programming | |||
building a text string while looping though a worksheet | Excel Programming |