View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
DJH DJH is offline
external usenet poster
 
Posts: 14
Default References to multiple sheets

Thanks, your first solution worked great.

"Tom Ogilvy" wrote:

Dim sh as worksheet
for each sh in ActiveWorkbook.Worksheets
sh.Range("5:8").Delete
Next

another way

Sub SS()
Set sh = ActiveSheet
ActiveWorkbook.Worksheets.Select
Range("5:8").Select
Selection.Delete
sh.Select
End Sub


--
Regards,
Tom Ogilvy


"djh" wrote in message
...
What is the correct syntax to process through all sheets in a workbook

when
you do not know how many sheets there will be? I want to have a macro run

to
delete certain rows in each sheet, but the number of sheets will vary.