View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
cluck cluck is offline
external usenet poster
 
Posts: 8
Default Delete range on open

Thanks Brian for you quick response, but
I don't understand why but it deleted the range in the worksheets that begin
with "ZZ". Here's what it looks like
Private Sub workbook_open()
'clear A9s
Dim WS As Worksheet
For Each WS In Worksheets
If Not Left(WS.Name, 2) = "ZZ" Then
Range("j29:q38").ClearContents
End If
Next

"Brian Taylor" wrote:

Sorry, I misunderstood slightly. Try this:

Dim WS As Worksheet
For Each WS In Worksheets
If not left(WS.Name,2) = "ZZ" Then
Range("j29:q38").ClearContents
End If
Next