Hi All,
I am after some code to create a new worksheet called 'xxxx' in my workbook, and then list all the sheets within the workbook (excluding the newly created 'xxxx' sheet.)
Hope someone can help.
Cheers
Hi All,
I am after some code to create a new worksheet called 'xxxx' in my workbook, and then list all the sheets within the workbook (excluding the newly created 'xxxx' sheet.)
Hope someone can help.
Cheers
Last edited by VBA Noob; 02-02-2009 at 08:55 AM.
One way:
Public Sub Sheet_Index() Dim ws As Worksheet Application.DisplayAlerts = False On Error Resume Next Sheets("xxxx").Delete On Error GoTo 0 Application.DisplayAlerts = True Sheets.Add After:=Sheets(ThisWorkbook.Sheets.Count) ActiveSheet.Name = "xxxx" Cells(1, "A") = "Sheet(s)" For Each ws In ThisWorkbook.Worksheets If ws.Name <> ActiveSheet.Name Then Cells(Rows.Count, "A").End(xlUp).Offset(1) = ws.Name Next ws End Sub
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
That's Great -Worked 1st Time! Much Appreciated
Cheers
Next time If you're satisfied with the solution(s) provided, please mark your thread as Solved.
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
_________________________________________
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
I know how to - I just forgot. Sorry
Cheers
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks