Hi,
I am trying to find a way to obtain the text from a comment in a cell. I need this to work similar to a lookup since the cell address will be dependant on the project number (to give the row) and the column header (to give the column).
I found a UDF on Ozgrid;
http://www.ozgrid.com/VBA/ExtractCommentText.htm
I can't figure out how to create the coordinates formula to give the column and row number and the code gives an argument error at the clean_ part;
Code:
Function GetCommentText(rCommentCell As Range)
Dim strGotIt As String
On Error Resume Next
strGotIt = WorksheetFunction.Clean _
(rCommentCell.Comment.Text)
GetCommentText = strGotIt
On Error GoTo 0
End Function
Any ideas?
I am trying to find a way to obtain the text from a comment in a cell. I need this to work similar to a lookup since the cell address will be dependant on the project number (to give the row) and the column header (to give the column).
I found a UDF on Ozgrid;
http://www.ozgrid.com/VBA/ExtractCommentText.htm
I can't figure out how to create the coordinates formula to give the column and row number and the code gives an argument error at the clean_ part;
Code:
Function GetCommentText(rCommentCell As Range)
Dim strGotIt As String
On Error Resume Next
strGotIt = WorksheetFunction.Clean _
(rCommentCell.Comment.Text)
GetCommentText = strGotIt
On Error GoTo 0
End Function
Any ideas?