Selecting workbook

L

Lazer

I have two workbooks. I want to delete worksheets from the one that i
not currently active. How do I do that? Right now it keeps deletin
the sheets from the active one...

Thanks!
Elieze
 
T

Tod

Make sure to refer to the workbook by name. So if the
workbook is called XYZ.xls (I'm so imaginative!), and it
is currently open:

Workbooks("XYZ").Worksheets("Sheet1").Delete

or

Workbooks("XYZ").Worksheets(1).Delete

tod
 
T

Tom Ogilvy

Specify the other workbook

workbooks("otherbookname.xls").Worksheets("Sheet3").Delete
 
Top