View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim[_22_] Jim[_22_] is offline
external usenet poster
 
Posts: 23
Default Macro keeps locking up Excel 97

I wrote this macro to add a new page of data as necessary and then it hides
the original. Initially I needed 50 pages, so I quick wrote a macro to run
the following macro 50x.

Sub MakeSheet()
'


'
X = Worksheets.Count
Y = X - 3
Sheets("Blank").Visible = True
Sheets("Blank").Copy After:=Sheets(X)
Sheets("Blank (2)").Select
Sheets("Blank (2)").Name = Y
Sheets("Blank").Visible = False
Worksheets(X + 1).Activate
ActiveSheet.Unprotect
Range("A1") = Y
ActiveSheet.Protect

End Sub

It locks up excel after 20 or so times. So I manually ran the macro by
clicking a button each time. Again after 20 or 30 times Excel locks up. Does
anyone know why?

Thanks, Jim