Tab Autofill

R

Robert Murray

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

Gord Dibben

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top