Selecting sheets starting with a certain prefix (VBA)

Giganews Newsgroups
Subject: Selecting sheets starting with a certain prefix (VBA)
Posted by:  Zark3 (Zark3n…@gmail.com)
Date: Wed, 16 Jul 2008

Hello,
Is there any way to use a wildcard or something in VBA when selecting
sheets? What I'm trying to accomplish is to print all sheets that
share a certain prefix. For example, my workbook contains sheets
123.a, 123.b, 123.c and Total. Now, I need to do something like
MyWorkbook.Sheets(Array("123.a", "123.b", "123.c")).Select:
MyWorkbook.SelectedSheets.PrintOut but of course without manually
specifying all possibilities but rather something like
MyWorkbook.Sheets("123.*").Select (which of course doesn't work but
illustrates what I want).
Does anybody have any suggestions?
Best,
Chris

Replies