98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Naming of newly created worksheets
Naming of newly created worksheets
Resolved · Low Priority · Version 2003
Emma has attended:
Excel VBA Intro Intermediate course
Naming of newly created worksheets
Hi,
I have a template worksheet.
I also have a list of people.
I'm trying to create a copy of the template worksheet for each person in the list.
So far, I've written code which works (see below) - except I want each worksheet to be named as the persons name (taken from the list) & all I'm getting is the row number.
I've attempted various things - but nothing successfully!
Thanks,
Emma
Option Explicit
Option Compare Text
Dim intRow As Integer
Sub CopyTemplate()
Dim intRowCount As Integer
For intRowCount = 2 To Sheets("List Page").Range("A1").CurrentRegion.Rows.Count
Sheets("Data").Select
Sheets("Data").Copy after:=Sheets(8)
ActiveSheet.Name = intRowCount
Next intRowCount
End Sub
RE: Naming of newly created worksheets
Hi Emma, thanks for your query. Try changing:
ActiveSheet.Name = intRowCount
to..
ActiveSheet.Name = Sheets("List Page").Range("A1").cells(introwcount, 1).value
Anthony
Mon 30 May 2011: Automatically marked as resolved.
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Create a unique items table from a duplicating table1. Ensure that your list has column headings |