How to get this to start in row 2

Closed
aaron - Jul 6, 2010 at 12:31 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jul 6, 2010 at 06:15 PM
Hello,

I like the code that makes the sheetnames appear in a new sheet
Sub SheetNames()
For i = 1 To Worksheets.Count
ActiveSheet.Cells(i, 1).Value = Worksheets(i).Name
Next i
End Sub


But how to i get this to start in the second row , when i run this macro now on a blank sheet, it starts in A cell 1, can i have it start in A cell 2 ?

Thanks

Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jul 6, 2010 at 06:15 PM
Sub SheetNames()
Dim lRow as Long
    lRow = 1
    For i = 1 To Worksheets.Count
        lRow = lRow + 1
        ActiveSheet.Cells(lRow, 1).Value = Worksheets(i).Name
    Next i
End Sub 
0