#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default Note or Comment

I have a spreadsheet that is on a shared drive and several people update this
sheet daily, I had found this VB that was posted by someone back in August of
this year and it works almost perfect except for one small item, HOW can I
track who is updating the cells, when the person puts the sheet on the shared
drive or emailed to one of the others and a cell is updated the name that
appears in the comment is the one who put the sheet on the drive and not the
person updating it. Is there a way to have the one who is updating the cell
to have their name add to the others who had update the cell earlier.

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.ColorIndex = 0
On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment < "" Then curComment = curComment & Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.BuiltinDocumentProperties("Author") & _
Chr(10) & " Rev. " & Format(Date, "yyyy-mm-dd ") & _
Format(Time, "hh:mm")
ActiveCell.Comment.Visible = False
'comment perhaps should be resized
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Note or Comment

Tank

Try username instead.

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.ColorIndex = 0
On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment < "" Then curComment = curComment & Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.Application.UserName & _
Chr(10) & " Rev. " & Format(Date, "yyyy-mm-dd ") & _
Format(Time, "hh:mm")
ActiveCell.Comment.Visible = False
'comment perhaps should be resized
End Sub


Gord Dibben MS Excel MVP

On Wed, 3 Jan 2007 11:44:00 -0800, tankerman
wrote:

I have a spreadsheet that is on a shared drive and several people update this
sheet daily, I had found this VB that was posted by someone back in August of
this year and it works almost perfect except for one small item, HOW can I
track who is updating the cells, when the person puts the sheet on the shared
drive or emailed to one of the others and a cell is updated the name that
appears in the comment is the one who put the sheet on the drive and not the
person updating it. Is there a way to have the one who is updating the cell
to have their name add to the others who had update the cell earlier.

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.ColorIndex = 0
On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment < "" Then curComment = curComment & Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.BuiltinDocumentProperties("Author") & _
Chr(10) & " Rev. " & Format(Date, "yyyy-mm-dd ") & _
Format(Time, "hh:mm")
ActiveCell.Comment.Visible = False
'comment perhaps should be resized
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default Note or Comment

Gord, you are the man, it works great but I have a couple questions. First
how do I keep the formatting color, some of the cells have a back ground
color but when the cell has anything entered into it the cell changes to a
white background.

Second I only need some of the cells to have the comments in them not all of
the sheet, what do I need to change to get only the cells I need to to have
the comments in them.

THANK YOU for the help this board has been a great help in almost all of my
endeavors to use EXCEL or ACCESS

"Gord Dibben" wrote:

Tank

Try username instead.

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.ColorIndex = 0
On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment < "" Then curComment = curComment & Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.Application.UserName & _
Chr(10) & " Rev. " & Format(Date, "yyyy-mm-dd ") & _
Format(Time, "hh:mm")
ActiveCell.Comment.Visible = False
'comment perhaps should be resized
End Sub


Gord Dibben MS Excel MVP

On Wed, 3 Jan 2007 11:44:00 -0800, tankerman
wrote:

I have a spreadsheet that is on a shared drive and several people update this
sheet daily, I had found this VB that was posted by someone back in August of
this year and it works almost perfect except for one small item, HOW can I
track who is updating the cells, when the person puts the sheet on the shared
drive or emailed to one of the others and a cell is updated the name that
appears in the comment is the one who put the sheet on the drive and not the
person updating it. Is there a way to have the one who is updating the cell
to have their name add to the others who had update the cell earlier.

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.ColorIndex = 0
On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment < "" Then curComment = curComment & Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.BuiltinDocumentProperties("Author") & _
Chr(10) & " Rev. " & Format(Date, "yyyy-mm-dd ") & _
Format(Time, "hh:mm")
ActiveCell.Comment.Visible = False
'comment perhaps should be resized
End Sub



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default Note or Comment

I have a couple of questions maybe you can address for me
First -- I am having trouble figuring our how to have the comment in just
certain cells, I have tried several differnt ways but I am stuck and unable
to exclude cells.

Second -- I tried to protect my sheet but when I do the coding wont work on
inserting the comments, I need an accurate list of the ones editing the
sheets and only on specific cells.

If you could help me with this I would certainly appreciate the help.
Tankerman

"Gord Dibben" wrote:

Tank

Try username instead.

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.ColorIndex = 0
On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment < "" Then curComment = curComment & Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.Application.UserName & _
Chr(10) & " Rev. " & Format(Date, "yyyy-mm-dd ") & _
Format(Time, "hh:mm")
ActiveCell.Comment.Visible = False
'comment perhaps should be resized
End Sub


Gord Dibben MS Excel MVP

On Wed, 3 Jan 2007 11:44:00 -0800, tankerman
wrote:

I have a spreadsheet that is on a shared drive and several people update this
sheet daily, I had found this VB that was posted by someone back in August of
this year and it works almost perfect except for one small item, HOW can I
track who is updating the cells, when the person puts the sheet on the shared
drive or emailed to one of the others and a cell is updated the name that
appears in the comment is the one who put the sheet on the drive and not the
person updating it. Is there a way to have the one who is updating the cell
to have their name add to the others who had update the cell earlier.

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.ColorIndex = 0
On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment < "" Then curComment = curComment & Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.BuiltinDocumentProperties("Author") & _
Chr(10) & " Rev. " & Format(Date, "yyyy-mm-dd ") & _
Format(Time, "hh:mm")
ActiveCell.Comment.Visible = False
'comment perhaps should be resized
End Sub



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Note or Comment

Tank

Assumes you have the cells in Const My_Range unlocked and sheet protected with
password of "justme"(no quotes)

Private Sub Worksheet_Change(ByVal Target As Range)
Const My_Range As String = "A1:A10"
' or "A1, A3, A6, A8, A10"
If Not Intersect(Target, Me.Range(My_Range)) Is Nothing Then
ActiveSheet.Unprotect Password:="justme"
Target.Interior.ColorIndex = 0
On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment < "" Then curComment = curComment & Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.Application.UserName & _
Chr(10) & " Rev. " & Format(Date, "yyyy-mm-dd ") & _
Format(Time, "hh:mm")
ActiveCell.Comment.Visible = False
ActiveSheet.Protect Password:="justme"
End If
'comment perhaps should be resized
End Sub


Gord

On Sun, 7 Jan 2007 21:22:00 -0800, tankerman
wrote:

I have a couple of questions maybe you can address for me
First -- I am having trouble figuring our how to have the comment in just
certain cells, I have tried several differnt ways but I am stuck and unable
to exclude cells.

Second -- I tried to protect my sheet but when I do the coding wont work on
inserting the comments, I need an accurate list of the ones editing the
sheets and only on specific cells.

If you could help me with this I would certainly appreciate the help.
Tankerman

"Gord Dibben" wrote:

Tank

Try username instead.

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.ColorIndex = 0
On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment < "" Then curComment = curComment & Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.Application.UserName & _
Chr(10) & " Rev. " & Format(Date, "yyyy-mm-dd ") & _
Format(Time, "hh:mm")
ActiveCell.Comment.Visible = False
'comment perhaps should be resized
End Sub


Gord Dibben MS Excel MVP

On Wed, 3 Jan 2007 11:44:00 -0800, tankerman
wrote:

I have a spreadsheet that is on a shared drive and several people update this
sheet daily, I had found this VB that was posted by someone back in August of
this year and it works almost perfect except for one small item, HOW can I
track who is updating the cells, when the person puts the sheet on the shared
drive or emailed to one of the others and a cell is updated the name that
appears in the comment is the one who put the sheet on the drive and not the
person updating it. Is there a way to have the one who is updating the cell
to have their name add to the others who had update the cell earlier.

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.ColorIndex = 0
On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment < "" Then curComment = curComment & Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.BuiltinDocumentProperties("Author") & _
Chr(10) & " Rev. " & Format(Date, "yyyy-mm-dd ") & _
Format(Time, "hh:mm")
ActiveCell.Comment.Visible = False
'comment perhaps should be resized
End Sub




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
How do I remove a comment, note, or ? kydan47 Excel Worksheet Functions 1 July 14th 06 08:19 PM
Cannot empty clipboard" MartinShort Excel Discussion (Misc queries) 9 July 14th 06 10:01 AM
How do I make make comment format default? delta_charm Excel Discussion (Misc queries) 1 July 8th 06 10:59 PM
comments at end of sheet are not printing correctly TreebeardEnt Excel Discussion (Misc queries) 0 June 7th 06 12:20 AM
can we attach an image file to a excel cell ,like note pad comment PR New Users to Excel 1 January 20th 06 05:08 PM


All times are GMT +1. The time now is 06:05 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"