S
srctr
I have this macro (inherited from another user) that will take all the sheet
names and put it in a list. My problem is it lists the last sheet first. I
need it skip the first sheet which is my master list and then starting with
the next sheet put them in order. Sheet1, Sheet2 etc. I know there is
something that is telling it what order to compile it, I just don't what.
Thanks,
cao
Sub WorksheetNamesList()
Dim wCtr As Long
Dim rCtr As Long
rCtr = 1
For wCtr = Worksheets.Count To 2 Step -1
rCtr = rCtr + 1
With ActiveSheet.Cells(rCtr, 1)
.NumberFormat = "@" 'text
.Value = Sheets(wCtr).Name
End With
Next wCtr
End Sub
names and put it in a list. My problem is it lists the last sheet first. I
need it skip the first sheet which is my master list and then starting with
the next sheet put them in order. Sheet1, Sheet2 etc. I know there is
something that is telling it what order to compile it, I just don't what.
Thanks,
cao
Sub WorksheetNamesList()
Dim wCtr As Long
Dim rCtr As Long
rCtr = 1
For wCtr = Worksheets.Count To 2 Step -1
rCtr = rCtr + 1
With ActiveSheet.Cells(rCtr, 1)
.NumberFormat = "@" 'text
.Value = Sheets(wCtr).Name
End With
Next wCtr
End Sub