ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro for sheet delete, very easy (https://www.excelbanter.com/excel-discussion-misc-queries/49866-macro-sheet-delete-very-easy.html)

comotoman

Macro for sheet delete, very easy
 

my code is:
Sheets("Sheet 1 (2)").Select
ActiveWindow.SelectedSheets.Delete

How can i hace it delete the seleted sheet, not always 'Sheet 1 (2)'?


--
comotoman
------------------------------------------------------------------------
comotoman's Profile: http://www.excelforum.com/member.php...o&userid=27292
View this thread: http://www.excelforum.com/showthread...hreadid=475211


Dave O

This code deletes the active sheet, with no prompt for confirmation:

Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete



All times are GMT +1. The time now is 04:00 AM.

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