View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Dr Dan[_2_] Dr Dan[_2_] is offline
external usenet poster
 
Posts: 19
Default If sheet name contains 'A' run macro1, if 'B' run macro 2?

Hi All,

I have a book with many sheets. The sheets contain two types of data. The
worksheet names contain either an 'A' or a 'B', e.g. 20210A.txt or 20210B.txt

Is it possible to have a macro that will start at the first worksheet, and
do the following:

Does worksheet name contain 'A'? If yes then run macro1.
If no, then does name contain 'B'? If yes run macro2.
Go to next worksheet.
End when no more sheets.

The macros are to plot charts of the data on that sheet, but as the data on
A and B sheets are for different graphs they need different macros.

Any help much appreciated.

Cheers,

Dan