View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Paulo Paulo is offline
external usenet poster
 
Posts: 47
Default deleting worksheets msg box

hi,
I am very new @ coding. just started yesterday...
I have 2 problems right now...
I have several tabs, and I whant a macro to erase em all, but , Sheet(1).
(1) my macro is kinda doing it, but i dont know how to make it to loop.
(2) as the macro runs the " Worksheets(DB).Delete " line, excel pops up a
msg box confirming the lost of data on the sheet deleted, how do i work
around that?

I thank in advance...
my curent code is
Private Sub CommandButton2_Click()
Dim x As Long
Dim DB As Long
Dim Wsht As Long
Wsht = Worksheets.Count
Debug.Print Wsht
For DB = 2 To Wsht
Debug.Print DB
Exit For
Next
Worksheets(DB).Delete
End Sub