Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Placement of comment box for a cell in Excel

Status
Not open for further replies.

cboz

Technical User
Dec 24, 2002
42
US
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
 
In stepping through the macro I discovered that Rows.RowHeight = 25 causes the comment box to move. I moved the RowHeight code to occur after the comment box is created and that solved my problem.

Does anyone know why setting the row height would move the comments box?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top