View Single Post
 
Old 01-15-2012, 08:43 AM
Catalin.B Catalin.B is offline Windows Vista Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

add this line:
Code:
ThisWorkbook.Sheets.Add After:=Sheets(Sheets.Count)
or:
Code:
Worksheets.Add().Name = "MySheet"
or, if you want to add more than 1 sheet, use:
Code:
Worksheets.Add After:=Worksheets(Worksheets.Count), Count:=4
to delete a sheet use:
Sheets("Sheet1").delete
or:
ActiveSheet.delete
Make sure to turn off events if you do not want to see the confirmation pop-up message: (change back to true after you delete the sheet)
Code:
Application.DisplayAlerts = False
Reply With Quote