Excel

TheSmallman.com

an XL ideas Lab

Dashboards VBA
  • Home
  • Dashboards
    • Tips & Tricks
    • Charts
    • Modelling
    • Infographics
    • VBA
  • Shop Dashboards
    • Power Pivot a User Guide
    • Excel Dashboard Course
    • Advanced Dashboard Course
    • Financial Modelling Course
    • Excel VBA Course
  • Blog
  • About
Menu

Excel Dashboards VBA

Street Address
City, State, Zip
Phone Number
an XL ideas Lab

Your Custom Text Here

Excel Dashboards VBA

  • Home
  • Dashboards
  • Excel Tips
    • Tips & Tricks
    • Charts
    • Modelling
    • Infographics
    • VBA
  • Shop Dashboards
  • PowerPivot
    • Power Pivot a User Guide
  • Courses
    • Excel Dashboard Course
    • Advanced Dashboard Course
    • Financial Modelling Course
    • Excel VBA Course
  • Blog
  • About

List All Sheets in a Excel Workbook

April 17, 2020 Marcus Small
List Sheets VBa

Creating worksheet tab names in a distinct and uneatable list is a tedious task. Using Excel VBA is the answer to this problem. Over the years I have worked with some large workbooks. At times finding sheets can be difficult. Also keeping track of all the sheets in the workbook via an index is often useful. In this case it could be advantageous to create a list of worksheets that can be updated by clicking a button or by merely clicking on the Excel sheet in question.


The following is the procedure to create the sheet tabs in a new worksheet entitled AllSheets. it is attached to a regular module. There is a file attached at the bottom of the page to help if you need a working copy of the code.

Option Explicit
Sub ListSheets() 'Excel VBA to list sheet names.
Dim i As Integer
Dim
sh As Worksheet
Const
txt = "AllSheets"

    If Not Evaluate("ISREF('" & txt & "'!A1)") Then 'Check for AllSheets tab.
        Set sh = Worksheets.Add
        sh.Name = txt
        sh.[A1] = "Workbook Sheets"
    End If
Set
sh = Sheets(txt)
    For i = 1 To Worksheets.Count
        sh.Cells(i + 1, 1) = Sheets(i).Name
    Next i
End Sub

The following file should help to crystallise the concept. Enjoy.

List All Sheets.xlsm

Tags Excel, VBA, Name all sheets, In Workbook
← Excel vba Scripting DictionaryExcel Dashboards: Tracking a Crisis →

Featured Posts

Excel Dashboards: Tracking a Crisis

Excel Dashboards: Tracking a Crisis
April 14, 2020

Recent Posts

Populating an Excel Table from a Range of Cells with VBA

Populating an Excel Table from a Range of Cells with VBA June 12, 2025

Fuzzy Distribution with Randbetween

Fuzzy Distribution with Randbetween May 21, 2025

Add Minimum and Maximum for Chart in Cells

Add Minimum and Maximum for Chart in Cells March 12, 2025

Inflation Over Multiple Years in a Single Cell

Inflation Over Multiple Years in a Single Cell January 10, 2025

Hubspot Dashboard

Hubspot Dashboard October 3, 2024

Monthly Dashboard With Supporting Metrics

Monthly Dashboard With Supporting Metrics September 25, 2024

Excel Show Missing Sheet Tabs

Excel Show Missing Sheet Tabs July 29, 2024

Run Macro Overnight Automatically

Run Macro Overnight Automatically June 24, 2024

Split File into Parts and Save to Directory

Split File into Parts and Save to Directory April 20, 2024

Most Popular Author

Most Popular Author December 14, 2023

 

Follow US:

 
 

MarcusSmall@thesmallman.com

 

TheSmallman.com - Making your small systems hum...
© Copyright 2013-2024 theSmallman.com All Rights Reserved.