Results 1 to 1 of 1

Workbook Tab names

Threaded View

  1. #1
    Registered User
    Join Date
    10-14-2006
    Posts
    41

    Question Workbook Tab names

    Locked.

    Reason: Duplicate Post

    Please read forum rules

    http://www.excelforum.com/showthread...76#post1802176


    I currently have workbook with multiple worksheets (tabs), each tab is named after cell “A1” by utilizing the following code:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$A$1" Then
    If Not IsEmpty(Target.Value) Then
    ActiveSheet.Name = Target.Value
        End If
    End If
    End Sub
    Then I have in another the code listed below:

    Sub loads4()
    '
    'Sub Loads #4'
    '
        Dim filevalue
        filevalue = Cells(135, 5).Value
        'L Load'
            Range("K136").Value = "=" & filevalue & "!K95"
        'R Load'
            Range("K137").Value = "=" & filevalue & "!K96"
        'E Load'
            Range("K138").Value = "=" & filevalue & "!K97"
        'K Load'
            Range("K139").Value = "=" & filevalue & "!K98"
        'S Load'
            Range("K140").Value = "=" & filevalue & "!K99"
            End Sub
    This allows me to get information from additional tabs by just entering the tab name “filevalue” and running the associated macro. The problem is that whenever I use the “-“symbol excel has a problem with it, and I need it for my sheet titles, is there a way to modify the VBA to change any “-“symbols to “.” When labeling the tab from the information from the cell indicated. The “.” Allows the macro to work but for some reason when I use the “-“everything goes haywire. Thanks in advance.
    Last edited by VBA Noob; 07-06-2007 at 08:39 AM.

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