Results 1 to 4 of 4

Worksheet Change Event-what I expect it to do

Threaded View

  1. #1
    Registered User
    Join Date
    12-13-2009
    Location
    new york, usa
    MS-Off Ver
    Excel 2003
    Posts
    17

    Question Worksheet Change Event-what I expect it to do

    I have the following code:

    Sub TabName()
        ActiveSheet.Name = ActiveSheet.Range("A5")
    End Sub
    The above code works fine, though I have to run the macro each time manually.

    I am trying to make it dynamic using the following code:

    Private Sub Worksheet_Change(ByVal Target As Range)
    
       If Target.Address = "$A$5" Then
    
            ActiveSheet.Name = ActiveSheet.Range("A5")
    
       End If
    End Sub

    This code does not do what I expect it to do, which is rename the sheet if i change the text in cell A5.

    Any help would be appreciated.
    Last edited by teylyn; 05-29-2010 at 08:11 AM. Reason: added code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1