How do I cycle through all of the worksheets

D

DMB

I need to check all of the worksheets to collect and sum contents. Is there a
with method or something along those lines?

WITH worksheets
if a = b then
Total = a1 + a1
end if
end with
 
B

Bob Phillips

For Each sh In Activeworkbook.Worksheets
If Range("A1").Value = Range("B1").Value Then
myTotal = myTotal + Range("A1").Value
End If
Next sh

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Top