Skip to content

Instantly share code, notes, and snippets.

@pokutuna
Created November 21, 2012 22:31
Show Gist options
  • Save pokutuna/4128291 to your computer and use it in GitHub Desktop.
Save pokutuna/4128291 to your computer and use it in GitHub Desktop.
ultra useful excel macro
Sub となりセルをコメントにし太郎()
Dim pos As Range
Dim relatedCell As Range
Set pos = Range(ActiveCell.Address)
Set relatedCell = pos.Offset(0, 1)
If Not relatedCell.Text = "" Then
On Error GoTo SET_COMMENT_ERROR
pos.AddComment
pos.Comment.Visible = False
pos.Comment.Text Text:=relatedCell.Text
End If
SET_COMMENT_ERROR:
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment