View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Barry Pettis Barry Pettis is offline
external usenet poster
 
Posts: 4
Default Automatic sheet naming

This code will loop through a column of data and create a new sheet name
from the data.

It does not check for length or invalid name characters.


Sub MakeNamedSheets()

' Loop through column where sheet names are stored
For Each cell In Sheet1.Range("A1:A65536")
If cell = "" Then Exit For
' Add a New Sheet
Sheets.Add
Sheets(ActiveSheet.Name).Name = cell
Next cell

End Sub


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!