I have a macro that adds a comment to a cell near the end of my spreadsheet. The only problem is the comment box is placed somewhere halfway up the spreadsheet out of sight of the cell it is tied to. How does Excel decide where to place the comment box and how do I get the box positioned next to the cell?
Here is my code:
lRow = ActiveSheet.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows).Row - 1
ActiveWindow.WindowState = xlNormal
ActiveSheet.Cells(lRow, 1).Select
With ActiveCell.AddComment
.Visible = True
.Text "Do not delete this row "
End With
Here is my code:
lRow = ActiveSheet.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows).Row - 1
ActiveWindow.WindowState = xlNormal
ActiveSheet.Cells(lRow, 1).Select
With ActiveCell.AddComment
.Visible = True
.Text "Do not delete this row "
End With