Activate a Pop Up Calendar Every Time a User Double Clicks in Column A or C

S

Steve

Hi All,



I have a worksheet were every time a user double clicks on cell A7 a pop up
calendar appears and

the user can select a date which is them entered into cell A7. I used the
following code to do this:



Private Sub Worksheet_BeforeDoubleClick( _

ByVal target As Excel.Range, _

Cancel As Boolean)

Dim addr As String

addr = target.Address

If addr = "$A$7" Then

Call OpenCalendar

End If

End Sub



What I would like to do is to have the pop up calendar appear every time a
user double clicks in

any cell in column A starting at A7 as well as any cell in column C starting
a column C7.



Any suggestions?



Thanks,



Steve
 
D

Dave Peterson

I'd use:

Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal target As Excel.Range, _
Cancel As Boolean)
If Intersect(target, Me.Range("a7:a65536,c7:c65536")) Is Nothing Then
Exit Sub
End If
Call OpenCalendar
End Sub
 
M

Mike Fogleman

OR:

Private Sub Worksheet_BeforeDoubleClick(ByVal target _
As Excel.Range, Cancel As Boolean)

If Not Application.Intersect(Range("A7:A65536,C7:C65536") _
, Target) Is Nothing Then

Call OpenCalendar
End If
End Sub


Mike F
 
D

Dave Peterson

I still have trouble wrapping my head around "not ... is nothing" <bg>. I guess
I'm just too positive!

Dave "PollyAnna" Peterson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top