Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Rod Rod is offline
external usenet poster
 
Posts: 108
Default User name , date and time

Hi all,

Merry christmas .

I need to insert a comment of user name, date and time automatically when a
cell is changed or in next cell user name , date and time should come
automatically.
date should not be changed to current date while reopen.

thank you.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default User name , date and time

Merry Christmas to you as well

Insert this macro in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
n = ActiveSheet.UsedRange.SpecialCells(xlComments).Cou nt
If n = 0 Then
Else
Set r = ActiveSheet.UsedRange.SpecialCells(xlComments)
If Intersect(r, Target) Is Nothing Then
Else
Target.Comment.Delete
End If
End If
With Target
.AddComment
.Comment.Visible = False
.Comment.Text Text:=Now() & " " & Environ("username")
End With
End Sub

Whenever a cell is changed via user input, the date, time, and username are
recorded in a comment in the cell.

REMEMBER: the worksheet code area, not a standard module.
--
Gary''s Student - gsnu200762


"Rod" wrote:

Hi all,

Merry christmas .

I need to insert a comment of user name, date and time automatically when a
cell is changed or in next cell user name , date and time should come
automatically.
date should not be changed to current date while reopen.

thank you.

  #3   Report Post  
Posted to microsoft.public.excel.misc
Rod Rod is offline
external usenet poster
 
Posts: 108
Default User name , date and time

Thank you Gary.
How do stop others to edit or delete that comment?
thanks in advance

"Gary''s Student" wrote:

Merry Christmas to you as well

Insert this macro in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
n = ActiveSheet.UsedRange.SpecialCells(xlComments).Cou nt
If n = 0 Then
Else
Set r = ActiveSheet.UsedRange.SpecialCells(xlComments)
If Intersect(r, Target) Is Nothing Then
Else
Target.Comment.Delete
End If
End If
With Target
.AddComment
.Comment.Visible = False
.Comment.Text Text:=Now() & " " & Environ("username")
End With
End Sub

Whenever a cell is changed via user input, the date, time, and username are
recorded in a comment in the cell.

REMEMBER: the worksheet code area, not a standard module.
--
Gary''s Student - gsnu200762


"Rod" wrote:

Hi all,

Merry christmas .

I need to insert a comment of user name, date and time automatically when a
cell is changed or in next cell user name , date and time should come
automatically.
date should not be changed to current date while reopen.

thank you.

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
Showing "Created by User, Date, Time" in Footer Mark Plaideau Excel Discussion (Misc queries) 0 April 9th 06 11:29 PM
Macro to record user name and date/time Maddoktor Excel Discussion (Misc queries) 0 December 8th 05 10:03 PM
Calculating days & time left from start date/time to end date/time marie Excel Worksheet Functions 7 December 7th 05 02:36 PM
Combined date time cell to separate date & time components Mark Ada Excel Discussion (Misc queries) 1 December 2nd 04 12:07 AM
Combined date time cell to separate date & time components Mark Ada Excel Worksheet Functions 1 December 2nd 04 12:04 AM


All times are GMT +1. The time now is 03:54 AM.

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"