ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete sheets (https://www.excelbanter.com/excel-programming/429195-delete-sheets.html)

Dias[_2_]

Delete sheets
 
Hi !
How can i delete sheets select name in list ?
I have a list of countries each one has a sheet with is name.
Wat i want is a code that wen i select one of those countries in the
list i can delete that sheet.
Sorry my English
Regards
Horacio

Don Guillett

Delete sheets
 
Right click sheet tab of listview codeinsert this.

Private Sub Worksheet_BeforeDoubleClick _
(ByVal Target As Range, Cancel As Boolean)
On Error GoTo nosheet
Application.DisplayAlerts = False
Sheets(CStr(Target)).Delete
Application.DisplayAlerts = True
nosheet:
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Dias" wrote in message
...
Hi !
How can i delete sheets select name in list ?
I have a list of countries each one has a sheet with is name.
Wat i want is a code that wen i select one of those countries in the list
i can delete that sheet.
Sorry my English
Regards
Horacio




All times are GMT +1. The time now is 05:01 PM.

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