Upload
bayu-aji-s
View
213
Download
1
Embed Size (px)
DESCRIPTION
ok
Citation preview
Excel - A macro to create and nameworksheets based on a listJune 2014
Excel - A macro to create and nameworksheets based on a list
IssueSolution
IssueI need a macro that can automatically create and rename worksheets, based on alist that exists in another sheet ("Summary") of the same workbook? The list begins at cell A10.How can this be implemented under Excel?
SolutionTry this:Sub CreateSheetsFromAList() Dim MyCell As Range, MyRange As Range Set MyRange = Sheets("Summary").Range("A10") Set MyRange = Range(MyRange, MyRange.End(xlDown))
For Each MyCell In MyRange Sheets.Add After:=Sheets(Sheets.Count) 'creates a new worksheet Sheets(Sheets.Count).Name = MyCell.Value ' renames the new worksheet Next MyCell End Sub Thanks to Ivan-hoe for this tip.
This document entitled Excel - A macro to create and name worksheets based on a list from Kioskea(en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page,under the conditions stipulated by the license, as this note appears clearly.