Maybe something like this:
Option Explicit
Sub testme()
Dim SumWks As Worksheet
Dim DestCell As Range
Dim wks As Worksheet
Dim iCtr As Long
Set SumWks = Worksheets("Summary") 'whatever you need
Set DestCell = SumWks.Range("B15")
iCtr = -1
For Each wks In ActiveWorkbook.Worksheets
If IsNumeric(wks.Name) Then
If Len(wks.Name) = 5 Then
iCtr = iCtr + 1
DestCell.Offset(iCtr, 0).Value = "'" & wks.Name
End If
End If
Next wks
With DestCell.Resize(iCtr + 1, 1)
.Cells.Sort key1:=.Columns(1), order1:=xlAscending, header:=xlNo
End With
End Sub
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
Kevin wrote:
--
Dave Peterson
|