+ Reply to Thread
Results 1 to 3 of 3

Creating a list of Sheets within a Workbook

  1. #1
    Registered User
    Join Date
    07-27-2010
    Location
    Wissington, England
    MS-Off Ver
    Excel 2007
    Posts
    1

    Creating a list of Sheets within a Workbook

    Hi all,

    First post, and possibly an impossible problem, I can't seem to find any information relating to it anywhere at least.

    What I need is to create a list of all the sheets in the workbook. As I have code to lock all the sheets individually etc, as locking the workbook doesn't seem to lock the locked cells

    But giving this to my end user they are more than likely going to add in more sheets, and so the lock code would need to auto update to accomodate the new sheets.

    On top of that, this code doesn't seem to be working either, (while your here ;-) )
    It should run through the workbook replaceing all 1,0.5, and x with blank, but it only works periodically, is the "Cells" command the wrong thing to use? I got this bit by just recording the macro while using Ctrl+F

    Cells.Replace What:="1", Replacement:="", LookAt:=xlWhole, SearchOrder _
    :=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
    Cells.Replace What:="0.5", Replacement:="", LookAt:=xlWhole, SearchOrder _
    :=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
    Cells.Replace What:="x", Replacement:="", LookAt:=xlWhole, SearchOrder _
    :=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
    Cheers in advance
    Matt

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Creating a list of Sheets within a Workbook

    Creating a list of all of the woksheets in a workbook is straightforward enough:

    Please Login or Register  to view this content.

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Creating a list of Sheets within a Workbook

    Hi,

    Add a new sheet called INDEX, and put this code in the sheet

    Please Login or Register  to view this content.
    To provide an automatically updated list of sheet names.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

+ 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