Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Add a comment when cells are changed

Hello

I have the range "D2:Q50" in the active sheet.
I am looking for a macro that will automatically insert a comment
("changed by username on now") into the cell changed.
I suspect that Private Sub Workbook_SheetChange plays a role here.
If you could help, please.

Regards
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Add a comment when cells are changed

How about something like this...

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Not Intersect(Target, Range("D2:Q50")) Is Nothing Then
On Error Resume Next
Target.Comment.Delete
Target.AddComment "Changed by " & Application.UserName & " on " & Now
End If
End Sub

--
Rick (MVP - Excel)


"dimbroane" wrote in message
...
Hello

I have the range "D2:Q50" in the active sheet.
I am looking for a macro that will automatically insert a comment
("changed by username on now") into the cell changed.
I suspect that Private Sub Workbook_SheetChange plays a role here.
If you could help, please.

Regards


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Add a comment when cells are changed

Excellent, it's quite perfect. Thank you.


On Dec 1, 7:45*pm, "Rick Rothstein"
wrote:
How about something like this...

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
* If Not Intersect(Target, Range("D2:Q50")) Is Nothing Then
* * On Error Resume Next
* * Target.Comment.Delete
* * Target.AddComment "Changed by " & Application.UserName & " on " & Now
* End If
End Sub

--
Rick (MVP - Excel)

"dimbroane" wrote in message

...

Hello


I have the range "D2:Q50" in the active sheet.
I am looking for a macro that will automatically insert a comment
("changed by username on now") *into the cell changed.
I suspect that Private Sub Workbook_SheetChange plays a role here.
If you could help, please.


Regards


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
Adding comment to cells not working with merged cells mcphc Excel Programming 2 August 29th 07 07:09 PM
Can Comment in a cell be changed as the content in another cell ?? Amit Kumar Baidyaka Excel Discussion (Misc queries) 3 January 10th 07 03:35 AM
Horizontal Cells changed to Vertical cells hoffman3[_4_] Excel Programming 2 September 26th 05 08:51 PM
Cell comment boxes shouldn't change size/shape unless changed by u sam Excel Discussion (Misc queries) 1 March 3rd 05 05:23 PM


All times are GMT +1. The time now is 05:24 AM.

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

About Us

"It's about Microsoft Excel"