Thread: deleting wksts
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 deleting wksts

Sub auto_open()
application.displayalerts = False
On Error Resume Next
Sheets("Base").Delete
On Error Goto 0
Application.DisplayAlerts = True

CopyInSameWorkbook
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"kaj1104 " wrote in message
...
Guys I have a problem

I created these procedures to execute when the file is opened. The
Base Wksht gets created, however if I open it up again and the base
wksht is already there it gives me an error. I need to have the base
wkst recreated every time the file opens. So basically base wkst needs
to be deleted before the program steps in copyinsameworkbook.

Can you guys help me out?


Sub auto_open()

CopyInSameWorkbook
End Sub




Sub CopyInSameWorkbook()
' Copying the entire sheet
Sheets("x").Select
Sheets("x").Copy Befo=Sheets(2)
Sheets(2).Name = "Base"
End Sub


---
Message posted from http://www.ExcelForum.com/