Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / May 2008

Tip: Looking for answers? Try searching our database.

Cell Change to Comment

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
buck.chicagocraigslist@gmail.com - 30 May 2008 23:52 GMT
Hi Everyone,

I found this code which is perfect for what I need to accomplish
except it doesn't do Formulas. i.e. Vlookups or direct links to other
workbooks.

Also this will only do Cell E5 in the work sheet I put it in. I would
like to get it to do it for cells A1:P500

I am a noob when it comes to VBA so please hang with me if I ask a
stupid question or two... ok three ;-)

Private Sub Worksheet_Change(ByVal Target As Range)
  If Target.Column <> 5 Then Exit Sub
  If Target.Row <> 5 Then Exit Sub
     Dim ccc As String
  ccc = Format(Date + Time, "mm/dd/yy hh:mm") _
     & " " & Target.Value  ' -- Application.UserName
  If Target.Comment Is Nothing Then
     Target.AddComment.Text ccc
  Else
     Target.Comment.Text (Target.Comment.Text & Chr(10) & ccc)
  End If
  Target.Comment.Shape.TextFrame.AutoSize = True
End Sub

Again any help would be appreciate. Thanks in Advance!!

Buck
Gary''s Student - 31 May 2008 01:38 GMT
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1:P500")) Is Nothing Then Exit Sub
Dim ccc As String
ccc = Format(Date + Time, "mm/dd/yy hh:mm") _
     & " " & Target.Value  ' -- Application.UserName
If Target.Comment Is Nothing Then
     Target.AddComment.Text ccc
Else
     Target.Comment.Text (Target.Comment.Text & Chr(10) & ccc)
End If
Target.Comment.Shape.TextFrame.AutoSize = True
End Sub

This version will cover A1 thru P500.
Signature

Gary''s Student - gsnu2007i

> Hi Everyone,
>
[quoted text clipped - 25 lines]
>
> Buck
buck.chicagocraigslist@gmail.com - 31 May 2008 06:38 GMT
On May 30, 5:38 pm, Gary''s Student
<GarysStud...@discussions.microsoft.com> wrote:
> Private Sub Worksheet_Change(ByVal Target As Range)
> If Intersect(Target, Range("A1:P500")) Is Nothing Then Exit Sub
[quoted text clipped - 45 lines]
>
> - Show quoted text -

Thanks Gary!!

Anyone have an idea on allowing this script to see Formulas?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.