Hi all,
I was hoping someone could help me with a query. I've got a working macro that loops through all the worksheets in a workbook, but excludes certain sheets that I specify in the code. This is done with the following:
IF worksheet.name <> "Pricing Source" AND worksheet.name <> "Control" THEN...
I'd like to know how to do two things. Firstly, how do you write out a list of names rather than having loads of 'AND's, i.e. something like:
If worksheet.name <> ("Pricing Source", "Control", "Name3", "Name4") THEN...
Secondly, and what will probably be more tricky, I was hoping to find out how to reference a list in a worksheet within the workbook. So, for example, say I have a list in column A of a sheet called 'Pricing Source'. This list corresponds to the names of all the worksheets in the workbook that I would like the macro to loop though. Is there a simple way to reference the list within th macro, so that it will work something like:
IF worksheetname IN (list of names in column A of 'Pricing Source') THEN...
To complicate things just a tiny bit, I don't want the first row of column A to be included in the list, and the list is likely to grow longer or shorter over time, so it can't be a static reference of certain cells.
Any help would be much appreciated!
Bookmarks