LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a Sheet From a Previous Sheet Macro Don Excel Worksheet Functions 3 November 10th 06 11:41 PM
HELP!! Unhide Sheet with Macro and focus on other sheet [email protected] Excel Discussion (Misc queries) 2 May 23rd 06 07:17 PM
use macro button to run macro in protected sheet earl Excel Discussion (Misc queries) 3 February 26th 06 10:21 PM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 06:11 PM
Macro, select Sheet "Number", NOT Sheet Name DAA Excel Worksheet Functions 4 November 30th 04 05:29 PM


All times are GMT +1. The time now is 02:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"