Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do i delete a macro in Excel 2003 when delete isn't highlight | Excel Discussion (Misc queries) | |||
how do I delete a worksheet from my workbook | New Users to Excel | |||
In a protected worksheet allow users to delete rows | Excel Worksheet Functions | |||
Delete row depending on criteria | Excel Discussion (Misc queries) | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions |