Creating a new tab and tab name using data from another sheet

sthack

New Member
Joined
Jul 27, 2009
Messages
1
I am trying to create new tabs in a workbook using data from sheet 1 in that same workbook. I would like each tab name to be the data that is in A1:A162, where A1 is the column heading. I tried the following macro but I kept getting error # 1004.

Sub AddSheets()
For Each TabName In Sheets(1).Range("A1:A162")
Sheets.Add
ActiveSheet.Name = TabName
Next
End Sub

Can somebody please help??? I have no VBA or macro experience.

Thanks!!!!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
I am trying to create new tabs in a workbook using data from sheet 1 in that same workbook. I would like each tab name to be the data that is in A1:A162, where A1 is the column heading. I tried the following macro but I kept getting error # 1004.

Sub AddSheets()
For Each TabName In Sheets(1).Range("A1:A162")
Sheets.Add
ActiveSheet.Name = TabName
Next
End Sub

Can somebody please help??? I have no VBA or macro experience.

Thanks!!!!
Hi Sthack,
I am not sure if I understand the issue, but from my understanding what you want is to create different work sheet tabs for the data in sheet 1.
If you want to create tab on basis of one coloumn data.....try
excel explosion:
http://www.datapigtechnologies.com/freeware.htm
 
Upvote 0

Forum statistics

Threads
1,215,647
Messages
6,126,006
Members
449,280
Latest member
Miahr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top