J
Jim May
The below code works perfectly for my workbook containing 103 worksheets;
At present it lists and numbers all my worksheets down Col A and B only.
I'd like to tweek it to output to only rows 1 - 20, meaning after the first
20 A1:B20 being filled -- transfer output to Column C, then after 20 down
(C120) to E:F and so on..
Loops at this point totally confuse me,, can some one assist?
TIA,
Sub ListWSNames()
Dim ws As Integer
Worksheets("Index").Activate
Cells.ClearContents
Range("B1").Select
For ws = 2 To Worksheets.Count
Worksheets("Index").Cells(ws - 1, 2) = _
Worksheets(ws).Name
ActiveCell.Offset(ws - 2, -1) = ws - 1
Next
Range("B1").Select
End Sub
At present it lists and numbers all my worksheets down Col A and B only.
I'd like to tweek it to output to only rows 1 - 20, meaning after the first
20 A1:B20 being filled -- transfer output to Column C, then after 20 down
(C120) to E:F and so on..
Loops at this point totally confuse me,, can some one assist?
TIA,
Sub ListWSNames()
Dim ws As Integer
Worksheets("Index").Activate
Cells.ClearContents
Range("B1").Select
For ws = 2 To Worksheets.Count
Worksheets("Index").Cells(ws - 1, 2) = _
Worksheets(ws).Name
ActiveCell.Offset(ws - 2, -1) = ws - 1
Next
Range("B1").Select
End Sub