Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / March 2008

Tip: Looking for answers? Try searching our database.

Worksheet Names

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
veggies27 - 11 Mar 2008 18:47 GMT
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.
Mike H - 11 Mar 2008 19:02 GMT
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

> 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 - 11 Mar 2008 22:13 GMT
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

> Hi,
>
[quoted text clipped - 10 lines]
> >
> > I want sheet1 to be renamed to be whatever is in sheet1!A1 for instance.

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.