Hello Again,
Greg Truby said:
Nate - this seems a bit sluggish on my machine. If you've got a better way to skin this cat, I'd love to see it.
The procedure's already been crafted per your last two code submissions eh, you've shown yourself the way.
Here's what the compilation of the thread's efforts-to-date looks like:
<font face=Courier New><SPAN style="color:darkblue">Sub</SPAN> fubar3()
<SPAN style="color:darkblue">Dim</SPAN> ws <SPAN style="color:darkblue">As</SPAN> Worksheet, cl <SPAN style="color:darkblue">As</SPAN> Range, OrigCl <SPAN style="color:darkblue">As</SPAN> <SPAN style="color:darkblue">String</SPAN>, z <SPAN style="color:darkblue">As</SPAN> <SPAN style="color:darkblue">Boolean</SPAN>
Application.ScreenUpdating = <SPAN style="color:darkblue">False</SPAN>
<SPAN style="color:darkblue">For</SPAN> <SPAN style="color:darkblue">Each</SPAN> ws <SPAN style="color:darkblue">In</SPAN> Worksheets([transpose(row(8:19))])
<SPAN style="color:darkblue">Set</SPAN> cl = ws.[c:c].Find("0", lookat:=xlWhole, LookIn:=xlFormulas)
<SPAN style="color:darkblue">If</SPAN> <SPAN style="color:darkblue">Not</SPAN> cl <SPAN style="color:darkblue">Is</SPAN> <SPAN style="color:darkblue">Nothing</SPAN> <SPAN style="color:darkblue">Then</SPAN>
<SPAN style="color:darkblue">Let</SPAN> OrigCl = cl.Address
<SPAN style="color:darkblue">If</SPAN> <SPAN style="color:darkblue">Not</SPAN> <SPAN style="color:darkblue">CBool</SPAN>(WorksheetFunction.Sum(cl(, 0).Resize(, 7))) <SPAN style="color:darkblue">Then</SPAN>
z = <SPAN style="color:darkblue">Not</SPAN> z: cl.EntireRow.Hidden = z
<SPAN style="color:darkblue">End</SPAN> <SPAN style="color:darkblue">If</SPAN>
Do: <SPAN style="color:darkblue">Set</SPAN> cl = ws.[c:c].FindNext(cl)
<SPAN style="color:darkblue">If</SPAN> cl <SPAN style="color:darkblue">Is</SPAN> <SPAN style="color:darkblue">Nothing</SPAN> <SPAN style="color:darkblue">Then</SPAN> <SPAN style="color:darkblue">Exit</SPAN> <SPAN style="color:darkblue">Do</SPAN>
<SPAN style="color:darkblue">If</SPAN> cl.Address = OrigCl <SPAN style="color:darkblue">Then</SPAN> <SPAN style="color:darkblue">Exit</SPAN> <SPAN style="color:darkblue">Do</SPAN>
<SPAN style="color:darkblue">If</SPAN> <SPAN style="color:darkblue">Not</SPAN> <SPAN style="color:darkblue">CBool</SPAN>(WorksheetFunction.Sum(cl(, 0).Resize(, 7))) <SPAN style="color:darkblue">Then</SPAN>
cl.EntireRow.Hidden = <SPAN style="color:darkblue">True</SPAN>
<SPAN style="color:darkblue">ElseIf</SPAN> z <SPAN style="color:darkblue">Then</SPAN>
OrigCl = cl.Address: z = <SPAN style="color:darkblue">Not</SPAN> z
<SPAN style="color:darkblue">End</SPAN> <SPAN style="color:darkblue">If</SPAN>
<SPAN style="color:darkblue">Loop</SPAN>
<SPAN style="color:darkblue">Set</SPAN> cl = Nothing: <SPAN style="color:darkblue">Let</SPAN> OrigCl = <SPAN style="color:darkblue">Empty</SPAN>
<SPAN style="color:darkblue">End</SPAN> <SPAN style="color:darkblue">If</SPAN>
<SPAN style="color:darkblue">Next</SPAN>
Application.ScreenUpdating = <SPAN style="color:darkblue">True</SPAN>
<SPAN style="color:darkblue">End</SPAN> <SPAN style="color:darkblue">Sub</SPAN></FONT>
This processes Subject Co.:Sheet9. I didn't time it, but it felt like less than minute... It is quite a bit of looping, despite the fact that the Find Method drastically reduces the loop. Still, probably faster than doing it by hand eh.
Hope this helps.