Results 1 to 5 of 5

Thread: View code (XP)

  1. #1
    2 Star Lounger
    Join Date
    Feb 2002
    Location
    Taranaki, New Zealand
    Posts
    193
    Thanks
    3
    Thanked 0 Times in 0 Posts

    View code (XP)

    When I right click on the tab I change the view code to
    Option Explicit

    Private Sub Worksheet_Calculate()
    If Me.Range("j8").Value <> "" Then
    Me.Name = Me.Range("j8").Value
    End If
    End Sub

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    End Sub

    So the tab should change to the number in J8. Well I have 75 worksheets and with 2 of them it works and the others stay as they are.

    Any suggestions ??

    Thanks heaps

  2. #2
    2 Star Lounger
    Join Date
    Feb 2002
    Location
    Taranaki, New Zealand
    Posts
    193
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: View code (XP)

    Don't worry... Don't know what happened but after I grouped the sheets and make some changes, the code worked.
    I was a tat hasty

    Thanks away

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: View code (XP)

    The Worksheet_Calculate event will fire when the worksheet is recalculated, i.e. when you enter or edit a formula, or when you change the value of one of the cells that contribute to the result of formulas, or when you force a recalculation (Ctrl+Alt+F9). As long as the sheet isn't recalculated, its name won't change.

  4. #4
    2 Star Lounger
    Join Date
    Feb 2002
    Location
    Taranaki, New Zealand
    Posts
    193
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: View code (XP)

    I use this feature often, must have made changes whilst doing it.
    It works and that is the main thing.
    Its ever so handy.

    Happy new year.. From a very hot NZ....

  5. #5
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: View code (XP)

    You should use the Worksheet_Change event not the Worksheet_Calculate event to do this.
    Legare Coleman

Posting Permissions

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