SimonGeoghegan
Board Regular
- Joined
- Nov 5, 2013
- Messages
- 68
Hi All,
I have a spreadsheet i'm using which has dates within different columns. I need to be able to identify the last cell in each row, which I have managed to do via:
For example, providing me with "$E$3"
From there, I have a UDF called "GetComment" (which I found from this site) that extracts the text from a comment within this cell. Unfortunately, when I wrap this UDF around the above code, it presents as #VALUE!.
If I use the UDF with the cell reference, it works;
However, used with the Address formula above, it doesnt work;
Does anyone have any ideas on this at all? Perhaps there is something I need to change within the UDF to refine it?
UDF Code below.
Help appreciated as always, thanks.
Simon
I have a spreadsheet i'm using which has dates within different columns. I need to be able to identify the last cell in each row, which I have managed to do via:
Excel Formula:
=ADDRESS(ROW(A3),MAX((D3:V3<>"")*COLUMN(D3:V3)),1)
For example, providing me with "$E$3"
From there, I have a UDF called "GetComment" (which I found from this site) that extracts the text from a comment within this cell. Unfortunately, when I wrap this UDF around the above code, it presents as #VALUE!.
If I use the UDF with the cell reference, it works;
Excel Formula:
=getComment(E3)
However, used with the Address formula above, it doesnt work;
Excel Formula:
=getComment(ADDRESS(ROW(A3),MAX((D3:V3<>"")*COLUMN(D3:V3)),1))
Does anyone have any ideas on this at all? Perhaps there is something I need to change within the UDF to refine it?
UDF Code below.
VBA Code:
Function getComment(xCell As Range) As String
'UpdatebyExtendoffice20180330
On Error Resume Next
getComment = xCell.Comment.Text
End Function
Help appreciated as always, thanks.
Simon