#1   Report Post  
Posted to microsoft.public.excel.misc
tj tj is offline
external usenet poster
 
Posts: 71
Default sheet1

Hi,

I would like to change/rename the sheet tab to automatically update to cell
in that sheet.

The tab is called sheet1, as soon as I go into sheet1 and update cell A1 to
WIP, the name of that sheet 1 should correspond to WIP.

Kindly assist

thanks
TJ
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default sheet1

Right click sheet tabview codeinsert this. If you want it to apply to ALL
sheets, place in the This_Workbook module instead

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < Range("a1").Address Then Exit Sub
ActiveSheet.Name = Target

End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"TJ" wrote in message
...
Hi,

I would like to change/rename the sheet tab to automatically update to
cell
in that sheet.

The tab is called sheet1, as soon as I go into sheet1 and update cell A1
to
WIP, the name of that sheet 1 should correspond to WIP.

Kindly assist

thanks
TJ


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 79
Default sheet1

TJ wrote:
Hi,

I would like to change/rename the sheet tab to automatically update to cell
in that sheet.

The tab is called sheet1, as soon as I go into sheet1 and update cell A1 to
WIP, the name of that sheet 1 should correspond to WIP.

Kindly assist

thanks
TJ


This code will do what you want

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Const sNAMECELL As String = "A1"
Const sERROR As String = "Invalid worksheet name in cell "
Dim sSheetName As String

With Target
If Not Intersect(.Cells, Range(sNAMECELL)) Is Nothing Then
sSheetName = Range(sNAMECELL).Value
If Not sSheetName = "" Then
On Error Resume Next
Me.Name = sSheetName
On Error GoTo 0
If Not sSheetName = Me.Name Then _
MsgBox sERROR & sNAMECELL
End If
End If
End With
End Sub

Credit to

http://www.mcgimpsey.com/excel/event...efromcell.html

found at their site.

It is always a good idea to google your request - you never know what will
come back

edvwvw

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200904/1

  #4   Report Post  
Posted to microsoft.public.excel.misc
tj tj is offline
external usenet poster
 
Posts: 71
Default sheet1

Thank you very much!


"edvwvw via OfficeKB.com" wrote:

TJ wrote:
Hi,

I would like to change/rename the sheet tab to automatically update to cell
in that sheet.

The tab is called sheet1, as soon as I go into sheet1 and update cell A1 to
WIP, the name of that sheet 1 should correspond to WIP.

Kindly assist

thanks
TJ


This code will do what you want

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Const sNAMECELL As String = "A1"
Const sERROR As String = "Invalid worksheet name in cell "
Dim sSheetName As String

With Target
If Not Intersect(.Cells, Range(sNAMECELL)) Is Nothing Then
sSheetName = Range(sNAMECELL).Value
If Not sSheetName = "" Then
On Error Resume Next
Me.Name = sSheetName
On Error GoTo 0
If Not sSheetName = Me.Name Then _
MsgBox sERROR & sNAMECELL
End If
End If
End With
End Sub

Credit to

http://www.mcgimpsey.com/excel/event...efromcell.html

found at their site.

It is always a good idea to google your request - you never know what will
come back

edvwvw

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200904/1


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
=[Book.xls]Sheet1!A1 and not c:\blah\=[Book.xls]Sheet1!A1 Gaijintendo Excel Discussion (Misc queries) 1 August 7th 08 09:29 AM
[=Sheet1!A1] - if i use Column A1 ('Sheet1') / A2 ('Sheet2') Lawrence C H Tan Excel Worksheet Functions 0 January 19th 07 08:29 PM
=IF(ISNONTEXT(Sheet1!C2),(A5=A5+1),(A5=1)) famdamly Excel Discussion (Misc queries) 1 December 12th 05 03:10 AM
merging sheet1 to sheet2 RyanFC Excel Worksheet Functions 3 August 22nd 05 08:55 PM
finding sheet1 nono Excel Discussion (Misc queries) 3 July 30th 05 02:33 PM


All times are GMT +1. The time now is 01:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"