G
Guest
Hello,
I'm using Excel 2003. I'm having trouble deleting a worksheet with VBA.
The code looks fine, even used MSDN to find some examples:
Worksheets("Sheet2").Delete
But it's not working. I open an Excel file in VBA, I add a sheet, copy data
from the sheet to another sheet, then delete the sheet, and save and close
the workbook. All of this is done with VBA. When I open up the workbook
manually, the sheet I thought I just deleted is still there. The copy and
paste are working fine.
Is there some prep-work that might need to take place before Excel allows
you to delete a sheet?
Any ideas?
Thanks,
Scott
I'm using Excel 2003. I'm having trouble deleting a worksheet with VBA.
The code looks fine, even used MSDN to find some examples:
Worksheets("Sheet2").Delete
But it's not working. I open an Excel file in VBA, I add a sheet, copy data
from the sheet to another sheet, then delete the sheet, and save and close
the workbook. All of this is done with VBA. When I open up the workbook
manually, the sheet I thought I just deleted is still there. The copy and
paste are working fine.
Is there some prep-work that might need to take place before Excel allows
you to delete a sheet?
Any ideas?
Thanks,
Scott