PC Review


Reply
Thread Tools Rate Thread

Change Comment.Author

 
 
KIM W
Guest
Posts: n/a
 
      23rd Jun 2009

I have learned that the Comment.Author is read-only. Is there any workaround
or technique to alter the author? (This is the username name displayed at
the bottom of Excel when a comment is opened.)
We are finding that the stickiness of the name of the person who happened to
create the comment is undesirable. Now that the workbook is "done", we'd
like to loop through the hundreds of comments and make the author our company
name.
 
Reply With Quote
 
 
 
 
AltaEgo
Guest
Posts: n/a
 
      24th Jun 2009


Dim OrigName
Const CoName = "yourCompany"

Sub WBClose()
If Application.UserName = CoName Then
Application.UserName = OrigName
End if
End Sub

Sub WbOpen()
OrigName = Application.UserName
Application.UserName = CoName
End Sub

See also
http://www.contextures.com/xlcomments03.html

--
Steve

"KIM W" <(E-Mail Removed)> wrote in message
news:A90EAA3C-FB3A-44B4-9AC9-(E-Mail Removed)...
> I have learned that the Comment.Author is read-only. Is there any
> workaround
> or technique to alter the author? (This is the username name displayed
> at
> the bottom of Excel when a comment is opened.)
> We are finding that the stickiness of the name of the person who happened
> to
> create the comment is undesirable. Now that the workbook is "done", we'd
> like to loop through the hundreds of comments and make the author our
> company
> name.


 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      24th Jun 2009

Kim

Try the below macro and feedback. This should replace all your comments with
the organization name. Change the organization name to suit

Sub Macro()
Dim myRange As Range, myCell As Range
Dim strTemp As String, strAuthor As String, strOrgName As String

strOrgName = "My Organization name"
For intSheet = 1 To Sheets.Count
Set myRange = Sheets(intSheet).UsedRange
For Each myCell In myRange
If Not myCell.Comment Is Nothing Then
strAuthor = myCell.Comment.Author
strTemp = myCell.Comment.Text
myCell.Comment.Delete
myCell.AddComment Replace(strTemp, strAuthor, strOrgName)
End If
Next
Next
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"KIM W" wrote:

> I have learned that the Comment.Author is read-only. Is there any workaround
> or technique to alter the author? (This is the username name displayed at
> the bottom of Excel when a comment is opened.)
> We are finding that the stickiness of the name of the person who happened to
> create the comment is undesirable. Now that the workbook is "done", we'd
> like to loop through the hundreds of comments and make the author our company
> name.

 
Reply With Quote
 
KIM W
Guest
Posts: n/a
 
      24th Jun 2009

I implemented the code below-- thanks. I learned some stuff and still have
issues:
1. My objective is to alter the name displayed at the bottom of the screen
with the text "Commented By" when a comment is selected-- not the name right
in the comment (because I remove that on each comment). I discovered by
using the code below that when a comment is created it uses the User Name set
in Excel Options as the name at the bottom-- not comment.author.
Alternatively, the User Name can be set in code using Steve's suggestion of
Application.UserName. So, I can work with this-- it is basically solved,
though it is not behaving exactly as expected.
2. Most of my comments have different fonts and dimensions-- I think I can
find how to copy the font, but how about the dimensions of the comment?
3. Many of my comments have a picture embedded in them-- this code below
blows away the picture. (To insert picture which is a .jpg screen shot in
comments I use Edit Comment... Format Comment... Fill... Color... Fill
Effects... Picture... Select Picture)

The business objective here is to remove the numerous spreadsheet builders'
names from comments and "brand" the application.

Thanks in advance for additional assistance.
KIM W.

"Jacob Skaria" wrote:

> Kim
>
> Try the below macro and feedback. This should replace all your comments with
> the organization name. Change the organization name to suit
>
> Sub Macro()
> Dim myRange As Range, myCell As Range
> Dim strTemp As String, strAuthor As String, strOrgName As String
>
> strOrgName = "My Organization name"
> For intSheet = 1 To Sheets.Count
> Set myRange = Sheets(intSheet).UsedRange
> For Each myCell In myRange
> If Not myCell.Comment Is Nothing Then
> strAuthor = myCell.Comment.Author
> strTemp = myCell.Comment.Text
> myCell.Comment.Delete
> myCell.AddComment Replace(strTemp, strAuthor, strOrgName)
> End If
> Next
> Next
> End Sub
>
> --
> If this post helps click Yes
> ---------------
> Jacob Skaria
>
>
> "KIM W" wrote:
>
> > I have learned that the Comment.Author is read-only. Is there any workaround
> > or technique to alter the author? (This is the username name displayed at
> > the bottom of Excel when a comment is opened.)
> > We are finding that the stickiness of the name of the person who happened to
> > create the comment is undesirable. Now that the workbook is "done", we'd
> > like to loop through the hundreds of comments and make the author our company
> > name.


 
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
Change Author Info on Comment - Word 2004 robo1991 Microsoft Word Document Management 1 8th Jul 2009 09:18 PM
Set author for a comment? Myles Microsoft Excel Misc 5 30th Mar 2009 07:09 PM
change comment author lee hite Microsoft Excel Discussion 2 14th Feb 2006 06:01 PM
Changing Comment Author Peter Microsoft Word New Users 2 22nd Jun 2005 06:09 PM
Comment author =?Utf-8?B?c3BhY2ViYXM=?= Microsoft Word Document Management 1 17th Dec 2004 06:19 PM


Features
 

Advertising
 

Newsgroups
 


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