LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Code for inserting Comment field with spreadsheet protection

I am a novice to VBA, but have included the following code to insert a
comment field with the date/time and user name:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 1 Then
comment = ("Cell Last Edited: ") & Now & (" by ") & Application.UserName
Target.Cells.NoteText comment
End If
End Sub


I have a range of cells that are allow particular users to update these
cells. When I turn on the spreadsheet protection I am getting the following
error:

Runtime 1004 Note text Method of Range class failed, and the debugger takes
me to Target.Cells.NoteText comment.

My question is, is there additional code needed? Or is my code bad when
using spreadsheet protection? How can I correct my code?

Any help is appreciated

 
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
Inserting a comment box in a protected worksheet mskpr1 Excel Discussion (Misc queries) 1 May 14th 09 05:31 PM
Can you print indicators when inserting a comment? Carmen Excel Worksheet Functions 2 April 14th 06 05:08 PM
Protection will not allow me to insert a comment Wising Up Girls Excel Worksheet Functions 1 April 10th 06 08:43 PM
Protection will not allow me to insert a comment Wising Up Girls Excel Discussion (Misc queries) 1 April 10th 06 08:33 PM
Inserting a chart instead of text into comment box Ashleigh K. Excel Programming 5 October 9th 03 11:13 PM


All times are GMT +1. The time now is 05:54 PM.

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"