Hi,
Conveniently there is an event handler exposed to accomodate this.
In Excel, right click on the worksheet tab of the worksheet containing the cell you want the message box to appear for and select 'view code'. This will open up the worksheet's code module in the VBIDE.
At the top of the code module there are two drop-down boxes. In the left-hand box select 'Worksheet'. In the right-hand box select 'BeforeDoubleClick'. Your code module will be populated with the following procedural skeleton:
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
End Sub
This procedure will be executed whenever the user double clicks on the worksheet. 'Target' holds a reference to the cell that was double clicked on so we can use this to check which cell was double clicked and then run code as necessary:
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim rngCell As Range
'create a reference to the cell we are interested in
Set rngCell = Range("B2")
'check to see if that cell was double clicked
If Not Intersect(rngCell, Target) Is Nothing Then
MsgBox "You double clicked on " & rngCell.Address
End If
End Sub
HTH,
Colin