#1
|
|||
|
|||
Create Multiple Tabs from Template
Hi Everyone
I am looking to create a macro that would allow me to create multiple worksheets (in the same workbook) from a single already created template. Ideally the tabs would also rename themselves based on a pre-existing list of employee numbers. And if at all possible each employee number on the list would have an hyperlink to its newly created worksheet. The VB code I currently have is as follows; Sub Add_Sheets() Dim rCell As Range Dim bTemplate As Worksheet Set bTemplate = Worksheet.Open("C:\Documents and Settings\me\Application Data\Microsoft\Templates\Attendance_Calendar.xlt", 0, True) For Each rCell In ThisWorkbook.Sheets("Sheet2").Range("A2:A518") bTemplate.Sheet(21).Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Cou nt) ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count).Nam e = rCell.Value Next rCell bTemplate: Close End Sub However I keep receiving several errors....can anyone help with this code, or suggest something similiar (even without hyperlinks) that would save me from having to manulally copy the template for each employee |
Tags |
hyperlinks, multiple tabs, re-name, template |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I create an index of every word in a document? | jbengal | Word | 5 | 11-23-2022 02:17 PM |
How to create a Dependent Drop-Down Picklist | ComcoDG | Word | 2 | 03-17-2009 07:57 AM |
Adjusting Tabs | erselking | Word | 1 | 10-23-2008 02:57 PM |
How Do I Create Excel Web Pages With Java | highbids | Office | 0 | 04-13-2006 06:53 PM |
Can't Create/Save/Print EPS | mark4man | Publisher | 2 | 11-08-2005 08:47 AM |