Link to home
Start Free TrialLog in
Avatar of Frank Freese
Frank FreeseFlag for United States of America

asked on

Tryingto ask question when I click on a cell

Ok folks,
I failed well on the code below. I have Cells O14:O23 such that when a user double clicks on one of those cells I want to ask them "Additional Information"
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
 MsgBox ActiveCell(13).Row.O, vbOKCancel, "Additional Information"
End Sub

Open in new window

First, I need help correcting the above code. Do I need to use CASE, which I am not good at, yet?
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(ActiveCell, Range("AQ14:Q23")) Is Nothing Then
    MsgBox ActiveCell(13).Row, vbOKCancel, "Additional Information"
End If
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Frank Freese

ASKER

I took the "Not" out before "Intersect" and changed MsgBox ActiveCell.Row to MsgBox "Click Yes for Additional Information" and did get a response so you answered the question. It has generated another question that I need to chew on tonight to see if I can solve it.
fantastic
Why have the user go through the extra step of having to Click yes to the magbox? Just show the userform if he double-clicks a cell in the range.
Great suggestion - I like that! Will have a follow-up later today