PC Review


Reply
Thread Tools Rate Thread

Add a comment when cells are changed

 
 
dimbroane
Guest
Posts: n/a
 
      1st Dec 2009
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 With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      1st Dec 2009
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" <(E-Mail Removed)> wrote in message
news:5eac1eba-d89a-4411-8be3-(E-Mail Removed)...
> 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 With Quote
 
dimbroane
Guest
Posts: n/a
 
      2nd Dec 2009
Excellent, it's quite perfect. Thank you.


On Dec 1, 7:45*pm, "Rick Rothstein"
<rick.newsNO.S...@NO.SPAMverizon.net> 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" <bujorimbro...@gmail.com> wrote in message
>
> news:5eac1eba-d89a-4411-8be3-(E-Mail Removed)...
>
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding comment to cell if value changed tpeter Microsoft Excel Programming 5 13th Nov 2009 12:46 PM
Adding comment to cells not working with merged cells =?Utf-8?B?bWNwaGM=?= Microsoft Excel Programming 2 29th Aug 2007 07:09 PM
My Comment balloons look weird! Font is changed, need help! =?Utf-8?B?YW5kcmVh?= Microsoft Word Document Management 1 21st Jan 2006 06:02 PM
Event on changed comment for a cell MattiasP Microsoft Excel Discussion 2 13th Jul 2005 03:17 PM
can comment indicator color be changed? =?Utf-8?B?S2FybA==?= Microsoft Excel Misc 2 28th Oct 2004 06:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:36 PM.