Solved How to create button to delete tabs with names in rng cells?

July 25, 2012 at 10:42:52
Specs: Windows Vista
I want to create a command button on MS Excel to delete all tabs that have their name figuring on a range of cells.

See More: How to create button to delete tabs with names in rng cells?

Report •


#1
Report •

#2
July 25, 2012 at 11:07:13
I know how to create a button; I just don't know how to "code" a way to delete all the tabs that have the same name as a range of cells.

Report •

#3
July 25, 2012 at 18:00:25
✔ Best Answer
Obviously, the list can not exist in a sheet that you want to delete...

Sub ByeByeSheets()
'Uncomment the next line if you don't want to see
'the Alert that Excel shows when you delete a sheet
  'Application.DisplayAlerts = False
     For Each shtName In Sheets(1).Range("A1:A10")
       Sheets(shtName.Value).Delete
     Next
   Application.DisplayAlerts = True
End Sub

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

Related Solutions


Ask Question