1. Anyway to shorten this?
2. Anyway to make the last column list only sheets that have not already been listed?
Richie helped with this one.
<pre>Sub ListSheets()
Dim ws As Worksheet, wsName As String
Dim colA As Integer, colC As Integer
colA = 2
colB = 2
colC = 2 'start on row2 to allow for heading in row1
colD = 2
Sheets(2).Columns("A:H").Clear
For Each ws In ThisWorkbook.Sheets
wsName = Right(ws.Name, 2) 'look at right last 2 letters of name
Select Case wsName
Case "CL"
Sheets(2).Cells(colA, 1).Value = ws.Name
colA = colA + 1
End Select
Next ws
For Each ws In ThisWorkbook.Sheets
wsName = Right(ws.Name, 3) 'look at right last 3 letters of name
Select Case wsName
Case "DTM"
Sheets(2).Cells(colB, 2).Value = ws.Name
colB = colB + 1
End Select
Next ws
For Each ws In ThisWorkbook.Sheets
wsName = Left(ws.Name, 3) 'look at left first 3 letters of name
Select Case wsName
Case "mis"
Sheets(2).Cells(colC, 3).Value = ws.Name
colC = colC + 1
Case Else
Sheets(2).Cells(colD, 4).Value = ws.Name
colD = colD + 1
End Select
Next ws
End Sub</pre>
2. Anyway to make the last column list only sheets that have not already been listed?
Richie helped with this one.
<pre>Sub ListSheets()
Dim ws As Worksheet, wsName As String
Dim colA As Integer, colC As Integer
colA = 2
colB = 2
colC = 2 'start on row2 to allow for heading in row1
colD = 2
Sheets(2).Columns("A:H").Clear
For Each ws In ThisWorkbook.Sheets
wsName = Right(ws.Name, 2) 'look at right last 2 letters of name
Select Case wsName
Case "CL"
Sheets(2).Cells(colA, 1).Value = ws.Name
colA = colA + 1
End Select
Next ws
For Each ws In ThisWorkbook.Sheets
wsName = Right(ws.Name, 3) 'look at right last 3 letters of name
Select Case wsName
Case "DTM"
Sheets(2).Cells(colB, 2).Value = ws.Name
colB = colB + 1
End Select
Next ws
For Each ws In ThisWorkbook.Sheets
wsName = Left(ws.Name, 3) 'look at left first 3 letters of name
Select Case wsName
Case "mis"
Sheets(2).Cells(colC, 3).Value = ws.Name
colC = colC + 1
Case Else
Sheets(2).Cells(colD, 4).Value = ws.Name
colD = colD + 1
End Select
Next ws
End Sub</pre>