Tab Autofill

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to autofill the tabs on a worksheet if you wanted to name a tab for each day of the month.
 
Robert

Using VBA macro.

Sub Add_New_Worksheets()
'adaptation of original code by Bernie Deitrick
Dim mySheet1 As Worksheet
Dim mySheet2 As Worksheet
Dim myCell As Range

Set mySheet1 = Worksheets("Sheet1")

For Each myCell In Range("A1:A31")
Set mySheet2 = Sheets.Add(Type:="Worksheet")
mySheet1.Activate
mySheet1.Range("A1").Value = myCell.Value
mySheet2.Name = Range("B1").Value & mySheet1.Range("A1").Value
Next myCell
End Sub

On Sheet1 enter 1 through 31 down column A. Enter March in B1

Run the macro to add 31 new sheets named March1 through March31

Delete Sheet1 when happy.

Gord Dibben Excel MVP
 
Back
Top