Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-30-2009, 11:54 AM
TeePee TeePee is offline
Novice
Create Multiple Tabs from Template
 
Join Date: Apr 2009
Posts: 1
TeePee is on a distinguished road
Default 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
Reply With Quote
Reply

Tags
hyperlinks, multiple tabs, re-name, template

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Multiple Tabs from Template 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

Other Forums: Access Forums

All times are GMT -7. The time now is 12:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft