• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Is it possible to find the names of all worsheets and store in the first sheet

Manish

Copy the following code into a code module in VBA and run

[pre]
Code:
Sub Sheet_Names()

Worksheets.Add before:=Sheet1
Set mysheet = ActiveSheet
i = 0
For Each sh In Sheets
i = i + 1
mysheet.Cells(i, 1).Value = sh.Name
Next sh
End Sub
[/pre]
 
Hi


try the following macro: it will put the name of each sheet from the selected row down.


Sub GetSheets()


For Each ws In Worksheets

Selection = ws.Name

Selection.Offset(1, 0).Select

Next


End Sub
 
Back
Top