Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code which acts on one sheet. How could I get it to
loop through all sheets. Sub sumrows() Dim LastRow As Long With Sheets("Jan 2009") .Range("b:b").AdvancedFilter _ Action:=xlFilterCopy, CopyToRange:=.Range("X1"), _ CriteriaRange:="", Unique:=True LastRow = .Cells(.Rows.Count, "X").End(xlUp).Row For Each cell In .Range("X2:X" & LastRow) If cell.Value = "" Then Exit Sub cell.Offset(0, 1) = _ Application.WorksheetFunction.SumIf( _ .Range("b:b"), "=" & cell.Value, .Range("D:D")) Next End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
For/Next Loop through worksheets | Excel Programming | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
(Complex) Loop within loop to create worksheets | Excel Programming | |||
Loop Through worksheets | Excel Programming |