Hello,
I want to have a list of all the worksheets in my workbook listed on another sheet.
Right now I have;
Sub SheetNames()
Dim wsheet As Worksheet
Set wsheet = Worksheets("Lists")
With ws
Columns(1).Insert
For i = 1 To Sheets.Count
Cells(i, 1) = Sheets(i).Name
Next i
End With
End Sub
I am trying to have the list populate on sheet name "Lists", however whenever I run the code, the output is on whatever page is currently open when I run it.
Any help?
Thank you,
I want to have a list of all the worksheets in my workbook listed on another sheet.
Right now I have;
Sub SheetNames()
Dim wsheet As Worksheet
Set wsheet = Worksheets("Lists")
With ws
Columns(1).Insert
For i = 1 To Sheets.Count
Cells(i, 1) = Sheets(i).Name
Next i
End With
End Sub
I am trying to have the list populate on sheet name "Lists", however whenever I run the code, the output is on whatever page is currently open when I run it.
Any help?
Thank you,