ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting worksheets privately (https://www.excelbanter.com/excel-programming/353383-deleting-worksheets-privately.html)

SusieQ[_6_]

Deleting worksheets privately
 

Hi,

Is there any way to delete the following worksheets without the program
asking the user if it is ok? ie. automatically without the user
knowing.

Workbooks(3).Activate
Worksheets("Main Components").Delete
Worksheets("Hook-Up Material (Mechanical)").Delete
Worksheets("Hook-Up Material (Electrical)").Delete
Worksheets("Spare Parts").Delete
Workbooks(3).Save

Thanks
Susie


--
SusieQ
------------------------------------------------------------------------
SusieQ's Profile: http://www.excelforum.com/member.php...o&userid=30818
View this thread: http://www.excelforum.com/showthread...hreadid=512734


Tom Ogilvy

Deleting worksheets privately
 
Application.DisplayAlerts = False
Workbooks(3).Activate
Worksheets("Main Components").Delete
Worksheets("Hook-Up Material (Mechanical)").Delete
Worksheets("Hook-Up Material (Electrical)").Delete
Worksheets("Spare Parts").Delete
Workbooks(3).Save
Application.DisplayAlerts = True

--
Regards,
Tom Ogilvy


"SusieQ" wrote in
message ...

Hi,

Is there any way to delete the following worksheets without the program
asking the user if it is ok? ie. automatically without the user
knowing.

Workbooks(3).Activate
Worksheets("Main Components").Delete
Worksheets("Hook-Up Material (Mechanical)").Delete
Worksheets("Hook-Up Material (Electrical)").Delete
Worksheets("Spare Parts").Delete
Workbooks(3).Save

Thanks
Susie


--
SusieQ
------------------------------------------------------------------------
SusieQ's Profile:

http://www.excelforum.com/member.php...o&userid=30818
View this thread: http://www.excelforum.com/showthread...hreadid=512734





All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com