Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Change Comment.Author


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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Change Comment.Author



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" wrote in message
...
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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Change Comment.Author


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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Change Comment.Author


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
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
Set author for a comment? Myles Excel Discussion (Misc queries) 5 March 30th 09 07:09 PM
how to change Author name Author name Excel Discussion (Misc queries) 2 April 29th 08 10:07 AM
Return Author Comment Pathogen Excel Programming 11 March 20th 07 11:26 PM
Change Author Name Dean Excel Programming 6 September 29th 06 10:18 PM
Changing Author Name in an existing cell's comment Bill[_14_] Excel Programming 2 July 16th 03 10:26 PM


All times are GMT +1. The time now is 04:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"