Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Howdie, I need to run a macro from within a sheet (currently called data), that does several things to the sheet, the last being to rename the sheet to the contents of cellb2. Whats the vb to rename a sheet to b2...? Thanks D *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
activesheet.name = Range("B2").Value
-- Regards, Tom Ogilvy "Darin Kramer" wrote in message ... Howdie, I need to run a macro from within a sheet (currently called data), that does several things to the sheet, the last being to rename the sheet to the contents of cellb2. Whats the vb to rename a sheet to b2...? Thanks D *** Sent via Developersdex http://www.developersdex.com *** |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try
Sub renmamethissheet() ActiveSheet.Name = Range("b2") End Sub -- Don Guillett SalesAid Software "Darin Kramer" wrote in message ... Howdie, I need to run a macro from within a sheet (currently called data), that does several things to the sheet, the last being to rename the sheet to the contents of cellb2. Whats the vb to rename a sheet to b2...? Thanks D *** Sent via Developersdex http://www.developersdex.com *** |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Darin,
This should do - paste it into the Code module of the "Data" worksheet Whenever you change the value in the cell with the name "TabName" (you can replace this with a cell reference if you want), the tabname will change to that value, renaming the worksheet accordingly. Regards Pete Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ws_exit: Application.EnableEvents = False If Target.Address = Range("TabName").Address Then Me.Name = Format(Target.Value) End If ws_exit: Application.EnableEvents = True End Sub "Darin Kramer" wrote: Howdie, I need to run a macro from within a sheet (currently called data), that does several things to the sheet, the last being to rename the sheet to the contents of cellb2. Whats the vb to rename a sheet to b2...? Thanks D *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Naming a sheet | Excel Discussion (Misc queries) | |||
naming sheet tab | Excel Worksheet Functions | |||
Naming Sheet | Excel Discussion (Misc queries) | |||
Sheet naming | Excel Programming | |||
Naming a new sheet. | Excel Programming |