renaming sheets-urgent

  • Thread starter Thread starter rvik
  • Start date Start date
R

rvik

hi,

i have 50 records in a column. I want to have equal number of
corresponding worksheets named on the records. CaN THIS BE
AUTOMATED???? Also the number of records may also vary on a day to day
basis.


Please help me.

Your help is thanked in advance.
 
This *might* be what you are looking for.

In Cell A1:A*, have the sheet names
In Cell B2, have =COUNTA(A1:A1000). (The range of names)

Make a new module with this code.

Dim cellname
Dim numberofsheets
Dim numberofrecords

Sub Createsheets()
numberofrecords = [B1]
For numberofsheets = 1 To numberofrecords
Worksheets("Sheet1").Activate
cellname = ActiveCell.Offset(numberofsheets - 1, 0).Value
Sheets.Add After:=Worksheets(Worksheets.Count)
ActiveSheet.Name = cellname
Next numberofsheets
End Sub

Have a button call Createsheets()

It works for me, as I add new names to the worksheet, and creates ne
sheets based on how many names are in column A. Try it out, might wor
for your needs.

-Bo
 
Back
Top