Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Sheetname = Cell content ........ is it possible?

Hi guys.

I´m having trouble with the following:

I need that the sheetename (tabname) can be updated
(renamed) via the content of a cell (a1). If the valeu of
the cell changes the name changes. It would be great if
it was automatic, if not i could create a macro to update
whenever the user wanted.

Thanks a lot!!!!

SpeeD
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Sheetname = Cell content ........ is it possible?

A subroutine like this would do the renaming:

Sub NameSheets()
Dim someSheet As Worksheet
For Each someSheet In ThisWorkbook.Sheets
someSheet.Name = someSheet.Cells(1, 1).Value
Next someSheet
End Sub

You could have a second subroutine fired by a sheet change or some other
event and have it call the sub above if that is what you want for
automation.

Steve


"SpeeD" wrote in message
...
Hi guys.

I´m having trouble with the following:

I need that the sheetename (tabname) can be updated
(renamed) via the content of a cell (a1). If the valeu of
the cell changes the name changes. It would be great if
it was automatic, if not i could create a macro to update
whenever the user wanted.

Thanks a lot!!!!

SpeeD


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Sheetname = Cell content ........ is it possible?

Great code!!! it does exacly want i want to do!!!

Thanks a LOT Gord!! :-)


SpeeD



-----Original Message-----
SpeeD

This code placed in a Worksheet Module will

automatically change the tab name
when A1 is altered.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address(False, False) = "A1" Then
On Error Resume Next
Me.Name = Target.Value
On Error GoTo 0
If Me.Name < Target.Value Then _
MsgBox Target.Value & _
" is not a valid sheet name or is a

Duplicate "
End If
End Sub

Gord Dibben Excel MVP - XL97 SR2 & XL2002

On Wed, 30 Jul 2003 17:21:28 -0700, "SpeeD"


wrote:

Hi guys.

I´m having trouble with the following:

I need that the sheetename (tabname) can be updated
(renamed) via the content of a cell (a1). If the valeu

of
the cell changes the name changes. It would be great if
it was automatic, if not i could create a macro to

update
whenever the user wanted.

Thanks a lot!!!!

SpeeD


.

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
what's the function to return a sheetname in a cell in Excel? judi Excel Worksheet Functions 3 October 2nd 08 11:43 PM
Automatically update SheetName in workbook sub if SheetName changes [email protected] Excel Discussion (Misc queries) 3 February 29th 08 04:33 PM
Using a cell to reference sheetname in vlookup function jnasr Excel Worksheet Functions 1 October 25th 06 05:06 PM
Accessing the sheetname in a cell Kanagabalan Excel Worksheet Functions 4 February 28th 06 10:56 AM
can formula to read sheetname from a cell? Todd Excel Worksheet Functions 2 December 8th 04 06:21 PM


All times are GMT +1. The time now is 06:09 PM.

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

About Us

"It's about Microsoft Excel"