LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default deleting worksheets msg box

JLGWIHIZ thanks for helping out ...

"JLGWhiz" wrote:

Sub DeleShts()
Dim sh As Worksheet
For Each sh In ThisWorkbook.Sheets
If Sheet.Name < "Sheet1" Then
sh.Delet
End If
Next
End Sub

"Paulo" wrote:

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



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting Worksheets Jeff Excel Programming 1 July 18th 07 04:55 AM
Deleting Worksheets Don Guillett Excel Programming 0 December 7th 06 06:55 PM
Deleting Worksheets Chip Pearson Excel Programming 0 December 7th 06 06:45 PM
Deleting Worksheets [email protected] Excel Programming 0 December 7th 06 06:36 PM
Deleting worksheets Alan L. Wagoner Excel Programming 4 January 24th 05 03:19 PM


All times are GMT +1. The time now is 06:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"