#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default Worksheet Names

Is it possible to name worksheets based on a formula?

I want sheet1 to be renamed to be whatever is in sheet1!A1 for instance.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Worksheet Names

Hi,

Right click the sheet tab, view code and paste this in

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

Mike

"veggies27" wrote:

Is it possible to name worksheets based on a formula?

I want sheet1 to be renamed to be whatever is in sheet1!A1 for instance.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Worksheet Names

Since it's based on a formula, then maybe using _calculate would be a better
event to use:

Option Explicit
Private Sub Worksheet_Calculate()
On Error Resume Next
Me.Name = Me.Range("a1").Value
If Err.Number < 0 Then
Beep
MsgBox "Invalid name in A1!"
Err.Clear
End If
On Error GoTo 0
End Sub





Mike H wrote:

Hi,

Right click the sheet tab, view code and paste this in

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

Mike

"veggies27" wrote:

Is it possible to name worksheets based on a formula?

I want sheet1 to be renamed to be whatever is in sheet1!A1 for instance.


--

Dave Peterson
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
Look up and match Vendor name in one cell of worksheet from list ofmultiple Vendor names in column of other worksheet insitedge Excel Worksheet Functions 2 March 11th 08 11:36 PM
Trying to list tab/worksheet names in a summary worksheet Mich Excel Discussion (Misc queries) 1 February 7th 08 02:07 AM
Adding worksheet tab names to the first worksheet adam Excel Discussion (Misc queries) 1 May 17th 06 02:07 AM
Worksheet names Ajay Excel Discussion (Misc queries) 2 January 12th 06 12:56 PM
How to link Excel worksheet tab names to dates in each worksheet? Pat Excel Worksheet Functions 9 January 31st 05 07:51 AM


All times are GMT +1. The time now is 04:48 AM.

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"