Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Insert sheet, move to end, rename with cell data.

I've spent most of my day trying to ask VB to do this for me, but don't
know how to communicate it correctly.

I have column A in "List"(Sheet1) with 150 entries.
I want to create 150 sheets with Sheet numbers of 2-151.
However, I would like for the tabs to read what the appropiate cell in
"List" says....

ie if
+++
(column A)
___
Fun
Not Fun
Cool
+++
was my column, I would like the first four tabs to read "List" (my
original sheet), "Fun", "Not Fun", and "Cool".

Then they would appear in Microsoft Visual Basic as Sheet1(List),
Sheet2(Fun), Sheet3(Not Fun), and Sheet4(Cool).

This doesn't need to be a macro - I think a sub would work easier.
Thanks for your help!

Chris T.

  #2   Report Post  
Dave O
 
Posts: n/a
Default

Here's code to do it- note that the names in List must all be valid tab
names.

Sub Add_From_List()
Dim Nayme As String
Dim K As Byte
K = 1


Range("a1").Select 'this is the first cell in List

Do Until ActiveCell.Value = "" 'Loop until a blank cell is encountered
Nayme = ActiveCell.Value
Sheets.Add
ActiveSheet.Name = Nayme
Sheets(Nayme).Move After:=Sheets(K + 1)
Sheets("List").Select
ActiveCell.Offset(1, 0).Select
K = K + 1
Loop
End Sub

  #3   Report Post  
 
Posts: n/a
Default

Anyone else who uses this code, note also that you will delete Sheet2
and Sheet3 before running the macro.

Some of the tab name problems are length (31 letters) and symbols like
(){}*.

Thanks a lot, Dave O! The code was great.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP REF. NEW DATA ONLY AS i MOVE TO ANY CELL IN THE NEW ROW/RANGE Charts and Charting in Excel 1 June 26th 05 02:35 PM
data from one sheet to several in sequential order! firecord New Users to Excel 6 June 22nd 05 05:10 PM
Does excel recognise names rather than cells? Sue Excel Worksheet Functions 9 May 22nd 05 04:51 AM
Multiple worksheet queries liam Excel Worksheet Functions 3 February 16th 05 06:52 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 01:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"