Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey Joel,
I think I did it. I inserted a new module and then copy/pasted your macro into here. So then I changed the word "Summary" in the macro to "data" and looked back at the "data" worksheet and all the worksheet names are there! Awesome! So if I add a new worksheet will the list just keep expanding? -- Thank You! "maijiuli" wrote: Thanks for looking Joel. So I copy/pasted your macro into VBA editor under the "data" worksheet and pressed play. I got the error: Run-time error '9': Subscrip out of range Sorry, I'm so dumb, I probably did it wrong. -- Thank You! "Joel" wrote: How is this code? Sub addindex() 'test for inded found = False For Each ws In Worksheets If ws.Name = "Index" Then found = True Exit For End If Next ws If found = True Then Sheets("Summary").Activate Else Worksheets.Add _ Befo=Worksheets(1) ActiveSheet.Name = "Index" End If RowCount = 1 For Each ws In Worksheets Cells(RowCount, "A") = ws.Name RowCount = RowCount + 1 Next ws End Sub "maijiuli" wrote: Hello, This will be a big question so I will ask in steps so I don't overwhelm one person. I have a file that contains over 50 worksheets and continues to add more worksheets. I would like to set up an index worksheet to be the first worksheet. This worksheet will be named "Index". In this index worksheet I want to create a drop down list where you could choose which worksheet you want to go to and once you select your desired worksheet and hit a command/execution button, it will take you there. So I guess my first step is to create the dynamic list. My first worksheet name is "Index". I created another worksheet named "data" just in case I will need to keep the Dynamic Named Range hidden so others don't see the background. The other worksheets are names of Insurance carriers: Blue Shield, HealthNet, Kaiser, Delta Dental, etc.... Q1. How can I create a list (dynamic) that will take each worksheet name and put it in the list automatically so I don't have to copy/paste each worksheet name - for existing worksheets and new worksheets. Thank you for your time, -- Thank You! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to create validation list of worksheet names | Excel Discussion (Misc queries) | |||
How do I create a list (Word) of the names on Excel worksheet tabs | Excel Worksheet Functions | |||
How do I create a dynamic range in a macro | Excel Worksheet Functions | |||
Create a list in one worksheet of the other worksheets' names | Excel Worksheet Functions | |||
Create drop list on form from range names? | Excel Programming |