View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Myles[_21_] Myles[_21_] is offline
external usenet poster
 
Posts: 1
Default Looping thru Sheets without activating


Another one that failed ...
Passing the current sheet as an argument, as in:

Sub LoopThruShtsIn2Phases()
Dim sh as Worksheet

For each sh in worksheets
Call DoSomething(sh)
Next

End Sub

Sub DoSomething(obSht) *'returns Object doesn't support this property
or method *error
Dim c as range

For each c in obSht.Range("a:a")
Is Not Isempty(c) Then

<CarryOutSomeActions

End if
Next
End Sub


--
Myles
------------------------------------------------------------------------
Myles's Profile: http://www.excelforum.com/member.php...o&userid=28746
View this thread: http://www.excelforum.com/showthread...hreadid=496613