Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HELP REF. NEW DATA ONLY AS i MOVE TO ANY CELL IN THE NEW ROW/RANGE | Charts and Charting in Excel | |||
data from one sheet to several in sequential order! | New Users to Excel | |||
Does excel recognise names rather than cells? | Excel Worksheet Functions | |||
Multiple worksheet queries | Excel Worksheet Functions | |||
GET.CELL | Excel Worksheet Functions |