This is the title of the macro
Code:
If ActiveCell.Comment Is Nothing Then
ActiveCell is the cell you have highlighted when yourun the macro. So this if statement checks if your current cell has no comment.
Code:
x = ""
ActiveCell.AddComment
If there was no comment, this code executes. x is a variable I chose to store the comment value. So if there was no comment, I define x as blank (""). Then I create a blank comment.
Code:
Else
x = ActiveCell.Comment.Text
End If
This else code executes if the if statement was false, so in this case if there really was a comment. In that case, we define x as the comment's text.
y is another variable, and here I store the cell value to it.
Code:
If y = Empty Then
'ActiveCell.Comment.Delete
If the cell was empty, then I delete the comment.
Code:
Else
'ActiveCell.Comment.Text = y
End If
Otherwise, I set the comment text to y. Remember that we previously defined y as the cell contents.
Code:
ActiveCell.Value = x
End Sub
Last, I set the cell value to x, which was the comment text. End Sub ends the macro.
Remember that an apostrophe (') mutes a line. So when I gave you the two variants of the macro, I just muted the portions that performed the actions you didn't want.
Keep on Googling. Macros can do just about anything, and it's a kick learning about them.