I'm not much of a programmer so I can't give you any code that will do this, but...

There are a couple of event macros that could trigger your function.

There's a Worksheet_SelectionChange event which is the equivalent of a single click event. When you select a cell it's the equivalent of a single click event.

There's also a Worksheet_BeforeDoubleClick event which is a left double click event.

Ask over in the VBA programming forum.