Results 1 to 5 of 5

Private Sub Workbook_SheetChange..issue

Threaded View

  1. #1
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,231

    Private Sub Workbook_SheetChange..issue

    Hello all

    having some trouble with my macro, as it doesnt appear to be working.

    I have a macro in place that changes the worksheet name based on the entry in cell E5.

    for some odd reason, after i re-opened the file, it stopped working. i have the workbook protected thru a password (u can run the password to unprotect sheet). but can someone pls let me know why the workbook is not updating the worksheet name when i change the entries in cell E5?

    I have the following formula in "this workbook"

    Private Sub Workbook_Open()
    
    For c = 1 To Sheets.Count
                   With Worksheets(c)
            .Protect Password:="analyst", userinterfaceonly:=True
            .EnableOutlining = True
        End With
    Next c
    
    End Sub
    
    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
      On Error GoTo Rename_Error
      If Target.Address = "$E$5" And Len(Target.Value) <> 0 Then _
        Sh.Name = Target.Value
      Exit Sub
    Rename_Error:
      MsgBox "The sheet name could not be renamed. Please check " & vbCrLf & _
            "that you did not use illegal characters."
    End Sub
    can someone pls advise..thx u
    Attached Files Attached Files
    Last edited by jw01; 08-09-2011 at 12:38 PM.

Thread Information

Users Browsing this Thread

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

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