Inserts new monthly sheet : Worksheet Add « Excel « VBA / Excel / Access / Word

Home
VBA / Excel / Access / Word
1.Access
2.Application
3.Data Type
4.Data Type Functions
5.Date Functions
6.Excel
7.File Path
8.Forms
9.Language Basics
10.Math Functions
11.Outlook
12.PowerPoint
13.String Functions
14.Windows API
15.Word
16.XML
VBA / Excel / Access / Word » Excel » Worksheet Add 




Inserts new monthly sheet
 
Sub NewMonth()
   Dim myWorksheet As Worksheet

   Worksheets(1).Copy After:=Worksheets(1)
   Set myWorksheet = Worksheets(2)
   myWorksheet.Name = Format(DateSerial(200081)"mmm yyyy")
   On Error Resume Next
   myWorksheet.Cells.SpecialCells(xlCellTypeConstants, 1).ClearContents
End Sub

 














Related examples in the same category
1.Add a new sheet with name in A1
2.Create a new sheet with month name and year as its name
3.Add a new Sheet
4.Creating a new worksheet for your workbook, and then it fills in several cells in that new worksheet.
5.Add a worksheet and append value
6.Add a worksheet and save it
7.Append a worksheet to the end of the worksheet list
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.