rename sheet automatically

  • Thread starter Thread starter Tami
  • Start date Start date
T

Tami

Hi new to excel and just want to rename the sheet automatically using a name
in a cell on the spreadsheet.

Thanks in advance
 
One way:

put this in your worksheet code module (right-click the worksheet tab
and choose View Code):

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If .Address(False, False) = "A1" Then
On Error Resume Next
Me.Name = .Text
On Error GoTo 0
End If
End With
End Sub


Change the cell reference to suit.
 
Do you mean something like this ...

ActiveSheet.Name = ActiveCell.Value

or something more complicated?
 
Hi,


Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Me.Name = Range("A1").Value
On Error GoTo 0
End Sub


--
Regards,
Soo Cheon Jheong
_ _
^¢¯^
--
 

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