How do I select multiple SPECIFIC sheets from an Excel Workbook?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hd95
    New Member
    • Nov 2008
    • 24

    How do I select multiple SPECIFIC sheets from an Excel Workbook?

    I know how to select 1 sheet or all sheets for an export command, but how would I for example, select "sheet1" and "sheet3" while ignoring "sheet2"?
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    This may be what you're looking for:
    Code:
    Sheets(Array("Sheet1", "Sheet3")).Select
    I should point out the very simple technique that I used to find this. You can use the same method to get a quick answer to many questions about MS Office products. In Excel (or Word, etc) just begin recording a macro. Perform the action that you're interested in, then stop recording. Edit the macro, and (tada!) there's the code to do it.

    Comment

    • hd95
      New Member
      • Nov 2008
      • 24

      #3
      Thanks. I used this method but I like your solution better
      Code:
      Sheets("Sheet1").Select
      Sheets("Sheet3").Select False

      Comment

      Working...