View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Looping worksheets in workbook


Application.DisplayAlerts = False
For Each sh In Activeworkbook.Worksheets
If sh.Range("A15").Value < "C" Then
sh.Delete
Else
sh.Range("A15").Value = "C"
End If
Next sh

--

HTH

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


"Wylie C" wrote in message
...
I need help with a macro that will loop through all worksheets in a

workbook
and delete the worksheet if the contents in A15 < "C" then re-loop and
delete the "C" in each workbook. Should I create a named range using A15

in
each workbook or just the cell reference as above?

Thank you.