Skip to content

Instantly share code, notes, and snippets.

@pokutuna
Created November 22, 2012 00:17
Show Gist options
  • Save pokutuna/4128665 to your computer and use it in GitHub Desktop.
Save pokutuna/4128665 to your computer and use it in GitHub Desktop.
Sub となりのセルをコメントにし二郎()
Dim targetCell As Range
Dim nextCell As Range
Do Until ActiveCell.Value = ""
Set targetCell = Range(ActiveCell.Address)
Set nextCell = targetCell.Offset(0, 1)
If Not nextCell.Text = "" And targetCell.NoteText = "" Then
targetCell.AddComment
targetCell.comment.Visible = False
targetCell.comment.Text Text:=nextCell.Text
End If
Selection.Offset(1, 0).Select
Loop
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment