S
shadowsong
i'm trying to paste comment text to the right of the commented cell,
but first i need to insert blank columns in which comments can be
pasted.
the macro is supposed to select all cells with comments, change the
selection all columns with comments, insert a new column to the right
of the selections, and paste the comment text (minus username) into the
new blank cell.
the rest of the macro works, but when i try to insert new columns to
the right of the selection i get an error 1004: cannot use that command
on overlapping sections. any ideas? here's what i have so far:
Sub comment_macro()
Dim CommentCells As Range
Dim MyCell As Range
ActiveSheet.UsedRange.SpecialCells(xlCellTypeComments).Select
Set CommentCells = Selection
Selection.EntireColumn.Select
Selection.Insert Shift:=xlToLeft
CommentCells.Select
For Each MyCell In CommentCells
MyCell.Offset(0, 1).Value = Mid$(MyCell.Comment.Text,
InStr(MyCell.Comment.Text, ":") + 1)
Next MyCell
End Sub
but first i need to insert blank columns in which comments can be
pasted.
the macro is supposed to select all cells with comments, change the
selection all columns with comments, insert a new column to the right
of the selections, and paste the comment text (minus username) into the
new blank cell.
the rest of the macro works, but when i try to insert new columns to
the right of the selection i get an error 1004: cannot use that command
on overlapping sections. any ideas? here's what i have so far:
Sub comment_macro()
Dim CommentCells As Range
Dim MyCell As Range
ActiveSheet.UsedRange.SpecialCells(xlCellTypeComments).Select
Set CommentCells = Selection
Selection.EntireColumn.Select
Selection.Insert Shift:=xlToLeft
CommentCells.Select
For Each MyCell In CommentCells
MyCell.Offset(0, 1).Value = Mid$(MyCell.Comment.Text,
InStr(MyCell.Comment.Text, ":") + 1)
Next MyCell
End Sub