Selecting workbook

  • Thread starter Thread starter Lazer
  • Start date Start date
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
 
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
 
Specify the other workbook

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top