find sheets with by part of name
If Left(ws.name,2)="TT" Or _
Left(ws.name,2)="ST" Then
Or a little simpler...
If ws.Name Like "[TS]T*" Then
--
Rick (MVP - Excel)
"Otto Moehrbach" wrote in message
...
Perhaps something like this:
For each ws in ThisWorkbook.Worksheets
If Left(ws.name,2)="TT" Or _
Left(ws.name,2)="ST" Then
'Copy/paste
End If
Next ws
Otto
"Robert H" wrote in message
...
I have a workbook that includes many sheets named "TT####" or ST####.
Also two summary sheets named TTall and STall.
Im working a a macro to find all the sheets beginning with TT or ST
then copy data from the sheets and paste that data in the respective
"__All" sheet. I can do all the copy and paste offsetting etc but
cannot figure out how to search through the sheet names for partial
names and work that into a for each statement.
I kick in the right direction would be helpful
|