Hello all, I'm new to VBA and inexperienced with code in general, and I was hoping someone could help me with a question. I'm collaborating on editing a document with multiple users, all of whom are making comments and formatting changes, and we want to present our edits to the author under a single name. I recently used code I found online (by Allen Wyatt, which I would link to if I were not newly registered here) to run a macro that efficiently replaced all of the user names for comments with a single name, which was incredibly helpful.
However, it didn't replace the user name of those who had made formatting changes, as can be seen in this screenshot, where I ran the code to replace the user name of those writing comments with "Test Author."
formatting.jpg
Does anyone know how I might modify the code in order to replace the user name of those making formatting changes as well? Here is the code:
Sub ChangeCommentAuthor()
Dim J As Integer
Dim sAuthorname As String
Dim sInitial As String
If Selection.Comments.Count = 0 Then
MsgBox "No comments in your selection!", _
vbCritical + vbOKOnly, "Cannot perform action"
Exit Sub
End If
sAuthorname = InputBox("New author name?", _
"Comments Author Name")
If sAuthorname = "" Then End
sInitial = InputBox("New author initials?", _
"Comments Initials")
If sInitial = "" Then End
With Selection
For J = 1 To .Comments.Count
.Comments(J).Author = sAuthorname
.Comments(J).Initial = sInitial
Next J
End With
End Sub
Thank you very much in advance for any assistance!