+ Reply to Thread
Results 1 to 4 of 4

How do I print out a list of the tabs in an Excel workbook?

  1. #1
    Britomart
    Guest

    How do I print out a list of the tabs in an Excel workbook?

    I have a large workbook that tracks computers for a company I work for, one
    tab per computer. I would like to print out jsut a list of the tab names as
    sort of an index file and check list for a physical inventory. Is this
    possible?

    thanks

  2. #2
    Otto Moehrbach
    Guest

    Re: How do I print out a list of the tabs in an Excel workbook?

    This macro will list all the sheet names in order in Column A of the active
    sheet, starting in A2. Column A must be empty for this to work. HTH Otto
    Sub ListShtNames()
    Dim ws as Worksheet
    For Each ws In ActiveWorkbook.Worksheets
    Range("A" & Rows.Count).End(xlUp).Offset(1).Value = ws.Name
    Next ws
    End Sub
    "Britomart" <[email protected]> wrote in message
    news:[email protected]...
    >I have a large workbook that tracks computers for a company I work for, one
    > tab per computer. I would like to print out jsut a list of the tab names
    > as
    > sort of an index file and check list for a physical inventory. Is this
    > possible?
    >
    > thanks




  3. #3
    Dave Peterson
    Guest

    Re: How do I print out a list of the tabs in an Excel workbook?

    How about just add the worksheet names to a worksheet and then print that?

    Option Explicit
    Sub testme()

    Dim rptWks As Worksheet
    Dim wks As Worksheet
    Dim ActWkbk As Workbook
    Dim oRow As Long

    Set ActWkbk = ActiveWorkbook

    Set rptWks = Workbooks.Add(1).Worksheets(1)

    oRow = 0
    For Each wks In ActWkbk.Worksheets
    oRow = oRow + 1
    rptWks.Cells(oRow, "A").Value = "'" & wks.Name
    Next wks

    End Sub


    If you're new to macros, you may want to read David McRitchie's intro at:
    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    Britomart wrote:
    >
    > I have a large workbook that tracks computers for a company I work for, one
    > tab per computer. I would like to print out jsut a list of the tab names as
    > sort of an index file and check list for a physical inventory. Is this
    > possible?
    >
    > thanks


    --

    Dave Peterson

  4. #4
    Gary Hallawell
    Guest

    Re: How do I print out a list of the tabs in an Excel workbook?

    Hi Otto

    Thanks a lot - it was exactly what I was looking for.

    "Otto Moehrbach" wrote:

    > This macro will list all the sheet names in order in Column A of the active
    > sheet, starting in A2. Column A must be empty for this to work. HTH Otto
    > Sub ListShtNames()
    > Dim ws as Worksheet
    > For Each ws In ActiveWorkbook.Worksheets
    > Range("A" & Rows.Count).End(xlUp).Offset(1).Value = ws.Name
    > Next ws
    > End Sub
    > "Britomart" <[email protected]> wrote in message
    > news:[email protected]...
    > >I have a large workbook that tracks computers for a company I work for, one
    > > tab per computer. I would like to print out jsut a list of the tab names
    > > as
    > > sort of an index file and check list for a physical inventory. Is this
    > > possible?
    > >
    > > thanks

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1