+ Reply to Thread
Results 1 to 2 of 2

I need to be able to define Sheets without knowing there name.

  1. #1
    Registered User
    Join Date
    07-05-2006
    Posts
    16

    I need to be able to define Sheets without knowing there name.

    I have a workbook (well actually a LOT of workbooks) with sheet names that correspond to a day (i.e. 09-05-06). There are 7 sheets per workbook, one for every day of the week. I'm trying to design a Macro to count the number of Yes and No's in the different columns on all seven of the sheets.

    What I'd like to do is somehow determine the names of all the sheets on the spread sheet so I could plug them into an array. Any idea how to do this?

  2. #2
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    I'm not sure why you would need this in the scenario you described. You could simply reference the worksheets by their index number like this

    Worksheets(1), Worksheets(2), etc.

    You could also loop through these worksheets without knowing their names like this

    Please Login or Register  to view this content.
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

+ 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