Consulting

Results 1 to 4 of 4

Thread: Worksheet tabs

  1. #1
    VBAX Newbie
    Joined
    Jan 2005
    Posts
    2
    Location

    Worksheet tabs

    I would like my worksheet tabs to automatically populate with data in a worksheet cell. Has anyone written code or have a suggestion for accomplishing this?

  2. #2
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Hi there, welcome to VBAX!


    You could try something like this ...

    Option Explicit
    
    Private Sub Worksheet_Change(ByVal Target As Range)
        On Error Resume Next
        If Target.Address = "$A$1" Then '<<-- CHANGE
            Me.Name = Target.Value
            If Err <> 0 Then
                MsgBox "Please enter a name, and no special characters!"
                Err.Clear
            End If
        End If
    End Sub
    Right click your sheet tab and select View Code. Paste on right. HTH

  3. #3
    VBAX Newbie
    Joined
    Jan 2005
    Posts
    2
    Location

    SOLVED: Worksheet TAB

    Wow Firefytr, you are the programmer!!! That worked great. Thanks for the solution and the welcome. This is a great site!!


  4. #4
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    LOL! Thanks!

    Glad it worked for you! As far as the solution goes, maybe we should make that a Knowledge Base entry.. Great idea!!

    Btw, did you know you can mark your own threads Solved? Go to Thread Tools --> Mark Solved --> Perform Action. This is possible because of Mark007 who programmed it for us!

Posting Permissions

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