I want to populate a column with hyperlinks that execute a VBA macro, which I have achieved by using the HYPERLINK
function:
=HYPERLINK("#AddReview()";"Add Review")
Since the HYPERLINK function will not invoke the Workbook_SheetFollowHyperlink
method, I created my own function as follows (simplified):
Public Function AddReview()
MsgBox Selection.Cells.Row
End Function
When the hyperlink is clicked the function does execute successfully, but the problem is that the function executes 3 times until it fails on the third run with the message Reference isn't valid
.
Does anybody have an idea why it would keep executing? I have not been able to find an answer.