Try this:
Sub UpdateSheetList()
Dim lngCount As Long
Dim i As Long
Dim wks As Worksheet
i = 0
lngCount = ThisWorkbook.Worksheets.Count
For i = 2 To lngCount - 1
Cells(i - 1, 1).Value = ThisWorkbook.Worksheets(i).Name
Next i
End Sub
-----Original Message-----
Hey all, Thanks for your help. I am looking at some code
to create a
sheetlist, and have something that gives me a list. I
now need to have
it skip the first and last worksheet in the file. Is
there any way to
do this? I tried doing a for...next loop, but couldnt
get it to work.
Thanks again.
Sub UpdateSheetList()
Dim i As Long, sh As Object
i = 0
For Each sh In Sheets
i = i + 1
Cells(i, 1).Value = sh.Name
Next
End Sub
--
trickdos
----------------------------------------------------------
--------------
trickdos's Profile: http://www.excelforum.com/member.php?
action=getinfo&userid=9405
View this thread:
http://www.excelforum.com/showthread...hreadid=267316
.