View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Les Stout[_2_] Les Stout[_2_] is offline
external usenet poster
 
Posts: 396
Default Help & Advise with code Please...

Hi all, i am trying using the code below to detect who is doing changes
and date and time. It is working, with the exception of the code after
going to the sub HoodPSC.
It runs one line of code then jumps back to the Worksheet_Change ????
Any help appreciated...


Option Explicit
Public UserName As String
================================================== =======
Public Function GetFullLoginName() As String
Dim Domain As String
Dim User As String
With CreateObject("Wscript.Network")
Domain = .UserDomain: User = .UserName
End With
GetFullLoginName = GetObject("WinNT://" & Domain & "/" & User &
",user").FullName

End Function
================================================== =======
Private Sub Worksheet_Change(ByVal Target As Range)
'
UserName = GetFullLoginName()
If Not Application.Intersect(Target, Range("HoodPSC")) Is
Nothing Then
HoodPSC
ElseIf Not Application.Intersect(Target, Range("BFPSC")) Is
Nothing Then
BFPSC '
ElseIf Not Application.Intersect(Target, Range("BRPSC")) Is
Nothing Then
BRPSC '
ElseIf Not Application.Intersect(Target, Range("FFMSPSC")) Is
Nothing Then
FFMSPSC '*
End If

End Sub
================================================== =======
Sub HoodPSC()

ActiveCell.Offset(0, -8) = Now 'after this it jumps back up to
"Sub_Worksheet Change" ????
Range("E6") = UserName

End Sub


Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***