Avatar of Frank Freese
Frank Freese
Flag 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?
Microsoft Excel

Avatar of undefined
Last Comment
Frank Freese

8/22/2022 - Mon
Martin Liss

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
Martin Liss

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
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.
Frank Freese

ASKER
fantastic
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Martin Liss

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.
Frank Freese

ASKER
Great suggestion - I like that! Will have a follow-up later today