Excel VBA Add Set of Worksheets Automatically
There is a time when we must create a set of Excel Worksheets templates on a regular basis in our work. For example, a set of Excel Worksheet for each month of the year or may be based on the type of work we should done in certain time base.
Here a simple example of how to create a new set 12 Worksheets for each month of the year.
Sub CreateMonthlyWorksheetTemplate()
Dim ix As Integer, oSheet As Worksheet, sMonth As String
For ix = 1 To 12
'add new worksheet
Set oSheet = Worksheets.Add
'get month name from index
sMonth = Format("1/" & CStr(ix), "mmm")
'rename the new worksheet
oSheet.Name = sMonth
Set oSheet = Nothing
Next ix
End Sub
Read also a previous post about how vba add worksheet complete with error handler when we counter duplicate Worksheet.
Related Entries
Create New Excel Worksheet With VBA
The Excel VBA macro below will create a new Excel Worksheet called ‘RawData’ or we can use msgbox to ask for the Worksheet name if needed. If there is already a Worksheet called RawData, user will be ask whether they want to use the old Worksheet and cancel new Worksheet creation, or delete the old Worksheet...
Sum Unique/Distinct Values in Excel
Usually in the sequential database system, we can SUM only unique values in table column by adding all the values from SELECT DISTINCT query result only. Based on the same principle, we can also create a simple VBA function in Microsoft Excel by adding the values only available in a collection of unique values we have...
Excel VBA Looping Tutorial
Do while … loop, do until … loop, do … loop while, do … loop until, and while … wend are the format of looping that we can use in Excel VBA. The main reason why we need to perform looping is to simplified a repeating tasks. Rather then manually calling a block of code over...
Find the Last Day of any Month
Simple Microsoft Excel formula to find the last day of any given month. ' =DATE(YEAR(A1),MONTH(A1)+1,0) ' ...
Auto Format Excel Cells with Error Value
With the simple Excel macro below, we can make all cells in active Worksheet that contains Error value in it, like #NULL, #Div/0!, #VALUE!, #Ref, #NAME?, #NUM!, And #N/A, will automatically having cell format that different/stand out among all other cells. In this example, background color of the cell that contains the error value will automatically...
Valuable Resources
- Microsoft Excel 2003/2007 Video Tutorials
Step-by-step video guide to mastering Charts, PivotTable, Data Analysis and Macro programming in Microsoft Excel in 5 hours.
- 101 Secrets of Microsoft Excel
Discover 101 of Excels little-known secrets that have been hiding right under your nose.
- Top Tips & Tricks to Get You Started in Microsoft Excel 2007
This is an ebook by Carol Bratt's, a Microsoft Certified Professional who has plenty of experience explaining things in simple English.
- Microsoft Office 2003/XP/2007 Training Videos
Discover an easy to use, hands-on interactive course that will teach you how to unleash the true power of Microsoft Office 2003/XP/2007.
If you found this page useful, please consider bookmark it using social media or add a link to this page.
Incoming search engine terms: excel vba create new worksheet, rename a tab based on a cell excel vba, vba macro create worksheets from list, macro insert new sheet excel, macro create new sheet and rename by cell, loop until sheet name is changed, how to make day by day worksheet in each sheet, how to insert new worksheet in excel 2007 automatically when row name changed, how to creat and rename sheets in excel macros, how to block out cells in excel 2007 based on a cells value, have excel auto add to column when adding new data in another list 2007, excel vba refresh when sheet selected, excel vba open worksheet template, excel vba loop new sheets, excel vba loop add next month name