Results 1 to 4 of 4

Auto Tab Naming

Threaded View

Gerard_Sanchez Auto Tab Naming 12-01-2009, 10:42 PM
Kristal_Miller Re: Auto Tab Naming 12-01-2009, 10:51 PM
Gerard_Sanchez Re: Auto Tab Naming 12-01-2009, 10:57 PM
Gerard_Sanchez Re: Auto Tab Naming 12-01-2009, 11:19 PM
  1. #1
    Registered User
    Join Date
    12-01-2009
    Location
    San Francisco, California
    MS-Off Ver
    Excel 2003
    Posts
    8

    Auto Tab Naming

    Can anyone help me to make the auto naming code displayed on the worksheet tab die after first entry into, so that regardless whether any values are changed in the worksheet--a minute, hour, day after-- the "namedate" stays the same.

    Any help would be greatly appreciated.


    Private Declare Function sndPlaySound32 Lib "winmm.dll" Alias _
        "sndPlaySoundA" (ByVal lpszSoundName As String, _
        ByVal uFlags As Long) As Long
    
    --------------------------------------------------------------------------
    Private Sub Worksheet_Change(ByVal Target As Range)
        
    'Automatically names the worksheet as date
    
    Dim dateTemp As Date
    
    ActiveSheet.Names.Add Name:="_timestamp", RefersTo:=Now()
    dateTemp = Val(Mid(ActiveSheet.Names("_timestamp"), 2))
    
    ActiveSheet.Name = Format(dateTemp, "MMM dd.hh.mm.ss")
    
    'Ding Sound whenever values have been keyed
         
    Set TargetRange = Range("H50:H51,H102:H103,H154:H155,H206:H207")
    Set isect = Intersect(Target, TargetRange)
    
    If Not isect Is Nothing Then
    If isect.Count > 1 Then Exit Sub
        If Target.Row Mod 2 = 0 Then
            If Target.Value = "" Or Target.Value = 0 Then Exit Sub
            If Target.Value = Target.Offset(1, 0).Value Then
                sndPlaySound32 "ding", 1&
            End If
        Else
            If Target.Value = "" Or Target.Value = 0 Then Exit Sub
            If Target.Value = Target.Offset(-1, 0).Value Then
                sndPlaySound32 "ding", 1&
            End If
        End If
    End If
    
    End Sub
    Last edited by Gerard_Sanchez; 12-01-2009 at 11:36 PM. Reason: Solved

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