Return the name of cell to sheet name

  • Thread starter Thread starter AndreaOlsson
  • Start date Start date
A

AndreaOlsson

How do I return the cell name to the sheet name. When I start a ne
sheet I write a name in a cell and I want it to automatically renam
the sheet to that cell name

//Andrea Olsso
 
introduce this in <thisworkbook> event
code begins
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
ActiveSheet.Name = Range("a1")
End Sub
code end

when you activate or insert a worksheet and then when you enter some value
in A1 the sheet name changes
if you have already invoked this macro again for the existing sheet if you
want to change the name just change the value of A1.

make a few experiments



=====================================================
 

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