Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Signature Authentication

I am trying to make my excel sheet automatically give off the date and time
when some data is inputted into the cells next to it. I managed to do this
with this code but wanted to add the security that the person signing off is
actually authentic. I tried to insert your code into my previous code and it
kept giving me "Method "Value" of Object "Range" failed". Do you have any
suggestions?

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo EndItAll
Application.EnableEvents = False
If Target.Cells.Column = 5 Or Target.Cells.Column = 8 Or
Target.Cells.Column = 11 Then
ActiveSheet.Unprotect Password:="justme"
For Each cell In Target
If cell.Value < "" Then
With cell.Offset(0, 1)
.Value = Now
.Locked = True
End With
End If
Next
End If
EndItAll:
Application.EnableEvents = True
'ActiveSheet.Protect Password:="justme"
Range("e2").Value = Environ("UserName")
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Signature Authentication

Hi Josh,

Try the following minor adaptation of
your code:

'===========
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rCell As Range
Const PWORD As String = "justme"

On Error GoTo EndItAll
Application.EnableEvents = False

With Me
If Target.Cells.Column = 5 _
Or Target.Cells.Column = 8 _
Or Target.Cells.Column = 11 Then
.Unprotect Password:=PWORD
For Each rCell In Target.Cells
If rCell.Value < "" Then
With rCell.Offset(0, 1)
.Value = Now
.Locked = True
End With
End If
Next
End If
EndItAll:
.Range("E2").Value = Environ("UserName")
.Protect Password:=PWORD
Application.EnableEvents = True
End With
End Sub
'<<===========


---
Regards.
Norman


"Josh" wrote in message
...
I am trying to make my excel sheet automatically give off the date and time
when some data is inputted into the cells next to it. I managed to do
this
with this code but wanted to add the security that the person signing off
is
actually authentic. I tried to insert your code into my previous code and
it
kept giving me "Method "Value" of Object "Range" failed". Do you have any
suggestions?

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo EndItAll
Application.EnableEvents = False
If Target.Cells.Column = 5 Or Target.Cells.Column = 8 Or
Target.Cells.Column = 11 Then
ActiveSheet.Unprotect Password:="justme"
For Each cell In Target
If cell.Value < "" Then
With cell.Offset(0, 1)
.Value = Now
.Locked = True
End With
End If
Next
End If
EndItAll:
Application.EnableEvents = True
'ActiveSheet.Protect Password:="justme"
Range("e2").Value = Environ("UserName")
End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change authentication in 2007? GD Excel Discussion (Misc queries) 1 May 6th 10 11:57 PM
Save As Authentication Issue From ASP.NET Matt Schwartz Excel Discussion (Misc queries) 0 June 9th 06 05:34 AM
MAC authentication in Excel VBA sieglej Excel Programming 0 June 1st 06 04:20 PM
Client Authentication [email protected] Excel Programming 2 September 30th 05 06:59 PM
authentication information? Kat Excel Discussion (Misc queries) 0 February 22nd 05 10:05 PM


All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"