Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 347
Default deleting selected worksheets using vb code

Can anybody tell how do I deleted selected worksheets using vb codes. The
whole code would also include clear contents of a number of cells in Sheet(2)
and deleting all sheets after sheet(2).
Thank you.
--
George
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default deleting selected worksheets using vb code

Maybe this'll get you started:

Option Explicit
Sub testme()

Dim iCtr As Long

Application.DisplayAlerts = False
For iCtr = Sheets.Count To Sheets("Sheet(2)").Index + 1 Step -1
Sheets(iCtr).Delete
Next iCtr

Worksheets("Sheet(2)").Range("a1:b3,c9,d12:e99").C learContents

End Sub


George wrote:

Can anybody tell how do I deleted selected worksheets using vb codes. The
whole code would also include clear contents of a number of cells in Sheet(2)
and deleting all sheets after sheet(2).
Thank you.
--
George


--

Dave Peterson
Reply
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
Text formatting Kace Excel Worksheet Functions 1 September 18th 06 08:28 PM
How to compress an Excel file once deleting extra worksheets Sandals Excel Discussion (Misc queries) 0 March 2nd 06 03:28 PM
Question about deleting rows from sorted linked worksheets DewChugr Excel Worksheet Functions 0 September 20th 05 09:25 PM
Using other workbooks.. DavidMunday Excel Worksheet Functions 2 July 1st 05 07:35 AM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM


All times are GMT +1. The time now is 05:26 PM.

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

About Us

"It's about Microsoft Excel"