Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
shrek
 
Posts: n/a
Default delete command macro's


I have a workbook which has 4 files within it. At present I have macro's
set up to delete the data within each file seperately. Can anyone help
me so that I can use just one macro to delete all the data from the
workbooks on one command instead of deleting them seperately.

Many Thanks


--
shrek
  #2   Report Post  
jahoobob
 
Posts: n/a
Default


shrek Wrote:
I have a workbook which has 4 files within it. At present I have macro's
set up to delete the data within each file seperately. Can anyone help
me so that I can use just one macro to delete all the data from the
workbooks on one command instead of deleting them seperately.

Many Thanks


I'm assuming you have one workbook with 4 worksheets that you want to
delete at on time. If so place this code in a macro:

Sub Macro1()
Sheets("Sheet1").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet4").Select
ActiveWindow.SelectedSheets.Delete
End Sub

Run it and it should delete all the named sheets.
Hope this answers your question
Bob


--
jahoobob
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
How do i delete a macro in Excel 2003 when delete isn't highlight Abel Excel Discussion (Misc queries) 2 September 13th 05 04:09 AM
how do I delete a worksheet from my workbook DLee New Users to Excel 2 August 15th 05 09:59 PM
In a protected worksheet allow users to delete rows Jason Trivett Excel Worksheet Functions 1 July 12th 05 09:50 AM
Delete row depending on criteria adw223 Excel Discussion (Misc queries) 1 June 30th 05 12:55 AM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM


All times are GMT +1. The time now is 08:04 AM.

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"