Looping through Worksheets in a Workbook with Similar Names

stirlingmw1

Board Regular
Joined
Jun 17, 2016
Messages
53
Office Version
  1. 2016
  2. 2013
  3. 2010
  4. 2007
Platform
  1. Windows
Afternoon All

I have a workbook with multiple worksheets (24) which I need to loop through checking for a certain text in row 1. If that text is found then that column is copied to another Sheet ("Results"). The text is set by items listed in the Named range "Locate" within Worksheet "Admin".

Each of the 24 worksheets have a 5 letter identifier followed by a Year span, i.e. BROC_22-23, BLYH_22-23. I have tried breaking down the Worksheet name to reference in separate parts but whatever I seem to do generates code errors.

Thanks

Steve
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
You can use the SPLIT function in VBA to split strings based on characters like "-" or "_".
See: MS Excel: How to use the SPLIT Function (VBA)

If you need help, please give us more details, i.e. what exactly is the criteria you want to use to determine which sheets to include and which to skip.
You gave us a few examples of sheet names, but not the logic to determine which to include.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,078
Latest member
skydd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top