'Add a Sheet After Last Sheet in a Single Action [1]
Sub AddNewSheet()
Application.ScreenUpdating = False ' Prevents screen refreshing.
' This line adds a new worksheet to the workbook. Alternatively, use:
'
' DialogSheets.Add Adds a dialog sheet.
' Charts.Add Adds a chart sheet.
' Modules.Add Adds a Visual Basic module.
' Sheets.Add Type:=xlExcel4MacroSheet Adds an MS Excel 4.0 macro
' sheet.
Worksheets.Add
' This line makes the new sheet (which is also the active sheet) the
' last sheet in the workbook.
ActiveSheet.Move After:=Sheets(ActiveWorkbook.Sheets.Count)
Application.ScreenUpdating = True ' Enables screen refreshing.
End Sub
Sub AddSheet() Application.EnableEvents = False ThisWorkbook.Sheets.Add Application.EnableEvents = True End Sub
0 comments:
Post a Comment