ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Create tabs named after a group of cells? (https://www.excelbanter.com/excel-discussion-misc-queries/111674-create-tabs-named-after-group-cells.html)

BM

Create tabs named after a group of cells?
 
Is it possible to create multiple tabs each being named after a particular
cell.

For example:

a1 Apple
a2 Pear
a3 Grape
a4 Banana

Could I somehow select that group of cells and have tabs automatically
generated named, Apple, Pear, Grape, and Banana?

I have a rather large list and would like to automate the process if possible.

Thanks in advance!

Gord Dibben

Create tabs named after a group of cells?
 
This macro will do what you wish.

Sub Add_Sheets()
Dim rCell As Range
For Each rCell In ActiveSheet.Range("A1:A10")
'alternative.......... For Each rCell In Selection
With Worksheets.Add(after:=Worksheets(Worksheets.Count) )
.Name = rCell.Value
End With
Next rCell
End Sub


Gord Dibben MS Excel MVP

On Tue, 26 Sep 2006 12:42:01 -0700, BM wrote:

Is it possible to create multiple tabs each being named after a particular
cell.

For example:

a1 Apple
a2 Pear
a3 Grape
a4 Banana

Could I somehow select that group of cells and have tabs automatically
generated named, Apple, Pear, Grape, and Banana?

I have a rather large list and would like to automate the process if possible.

Thanks in advance!



Paul B

Create tabs named after a group of cells?
 
BM, you can with a macro,

Sub Name_Sheets()
Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("A1"), Range("A1").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(after:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng

End Sub

And if you are new to macros you may also what to have a look here on
getting started with macros

http://www.mvps.org/dmcritchie/excel/getstarted.htm
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"BM" wrote in message
...
Is it possible to create multiple tabs each being named after a particular
cell.

For example:

a1 Apple
a2 Pear
a3 Grape
a4 Banana

Could I somehow select that group of cells and have tabs automatically
generated named, Apple, Pear, Grape, and Banana?

I have a rather large list and would like to automate the process if
possible.

Thanks in advance!




Dave F

Create tabs named after a group of cells?
 
Just make sure none of the names in the range repeat each other; i.e., they
have to be unique names. Otherwise this code returns an error.

Dave
--
Brevity is the soul of wit.


"Gord Dibben" wrote:

This macro will do what you wish.

Sub Add_Sheets()
Dim rCell As Range
For Each rCell In ActiveSheet.Range("A1:A10")
'alternative.......... For Each rCell In Selection
With Worksheets.Add(after:=Worksheets(Worksheets.Count) )
.Name = rCell.Value
End With
Next rCell
End Sub


Gord Dibben MS Excel MVP

On Tue, 26 Sep 2006 12:42:01 -0700, BM wrote:

Is it possible to create multiple tabs each being named after a particular
cell.

For example:

a1 Apple
a2 Pear
a3 Grape
a4 Banana

Could I somehow select that group of cells and have tabs automatically
generated named, Apple, Pear, Grape, and Banana?

I have a rather large list and would like to automate the process if possible.

Thanks in advance!





All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com