PDA

View Full Version : Renaming sheet name



ssinghal
03-25-2008, 09:00 AM
i need to rename a sheet name to be what is in cell N8 on that sheet. Must be a simple one.

Ago
03-25-2008, 09:16 AM
ActiveSheet.Name = range("N8").value


if its the current sheet you are talking about

lucas
03-25-2008, 09:20 AM
ActiveSheet.Name = Range("N8").Value

Bob Phillips
03-25-2008, 09:20 AM
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "N8" '<== change to suit

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Me.name = .Value
End With
End If
End Sub


This is worksheet event code, which means that it needs to be
placed in the appropriate worksheet code module, not a standard
code module. To do this, right-click on the sheet tab, select
the View Code option from the menu, and paste the code in.