ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel comments replace author (https://www.excelbanter.com/excel-discussion-misc-queries/80275-excel-comments-replace-author.html)

Not_an_expert

Excel comments replace author
 
Is there a way to change Globally author in comments in Excel. ta

Dave Peterson

Excel comments replace author
 
You'd have to use a macro.

Saved from a previous post:

Option Explicit
Sub testme01()

Dim FoundCell As Range
Dim FindWhat As String
Dim WithWhat As String

FindWhat = "ASDF"
WithWhat = "qwer"

Do
Set FoundCell = ActiveSheet.Cells.Find(What:=FindWhat, _
After:=ActiveCell, _
LookIn:=xlComments, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=True)

If FoundCell Is Nothing Then
Exit Do
Else
FoundCell.Comment.Text _
application.substitute(FoundCell.Comment.Text, _
FindWhat, WithWhat)
End If
Loop

End Sub

application.substitute is case sensitive--so you'll have to match case.


======
If you're using xl2k or higher, you can use replace instead of
application.substitute and that can be made non-case sensitive.


Not_an_expert wrote:

Is there a way to change Globally author in comments in Excel. ta


--

Dave Peterson

David McRitchie

Excel comments replace author
 
and to change for the future with the name you want
tools, options, General, User Name:




All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com