Macro Copy Worksheet Name into worksheet A1

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a 50 page workbook. I would like to create a macro to copy each
Worksheet name into each of their perspective A1 cells.

A1 in worksheet1 would display Worksheet1
A1 in worksheet2 would display Worksheet2

thank you
 
hi
Sub namesheets()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Cells(1, 1).Value = ws.Name
Next ws
msgbox Done
End Sub
 
thank you all for responding so quickly.
I found what I was looking for in this function:

=MID(CELL("filename",A1), FIND("]", CELL("filename", A1))+ 1, 255)

I will also investigate the links you have all suggesed to me as well.

this group is awsome.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top