Link cells when initials are entered, it time stamps the next???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please tell me if it's possible to link 2 cells when you enter initials in
one cell, it will date/time stamp the linked cell....Is this possible?
 
Sammie

You can use event code to achieve this.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1")) Is Nothing Then
With Target
If .Value <> "" Then
Range("F1").Value = Format(Now, "dd mmm yyyy hh:mm:ss")
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

This is worksheet event code. Right-click on the sheet tab and "View Code".

Copy/paste the above into that sheet module.

When you enter something in A1, F1 will show date/time of entry.

For a range of cells use.........

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A20")) Is Nothing Then
With Target
If .Value <> "" Then
.Offset(0, 5).Value = Format(Now, "dd mmm yyyy hh:mm:ss")
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP
 
OK Gordon, I am totally lost.....what exazctly do I have top paste into the
cell? (without all the extra stuff)!!!
I really appreciate the info, and I thought I was an advanced user!! you
just showed me I wasn't!~~ LOL
 
Sammie

You paste nothing into a cell.

Follow the instructions and paste the code into the sheet module.

When you type something into A1, F1 will get a data/time stamp which will not
update unless you edit A1 or re-type a new set of initials.

If you don't wish to bother with all the extra stuff, just hit CTRL + ; <space>
CTRL + SHIFT + ; to enter a static date/time into a cell.


Gord
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top