LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 536
Default Double click fails to run the code, just selects the cell

If I double click any one of these cell of this line of code, the double click just selects that cell, cursor blinking and cell in the edit mode.

If Target.Address = "$G$14,$G$36,$G$58,$G$80" Then

Each of these cells contain a Vlookup formula:

=IF(ISERROR(VLOOKUP(G7,$AJ$4:$AL$43,3,0)),"",VLOOK UP(G7,$AJ$4:$AL$43,3,0))

and will return a blank cell, or one of these strings, Notes_1, Notes_2 or Notes_3

I think my "If Target.Address =" line is the culprit. I have made the code work with a single "If Range("G14").Value = "Notes_1" Then" statement.

Thanks.
Howard

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim MyIntl As String
Dim MyNote As String

MyNote = Target.Value

If Target.Address = "$G$14,$G$36,$G$58,$G$80" Then
MyIntl = InputBox("Enter your Initials :", "Read Notes.")
If Len(MyIntl) = 0 Then
MsgBox "Enter your initials to read notes", vbCritical
Else
Cells(Rows.Count, "AN").End(xlUp).Offset(1, 0) = MyIntl
Cells(Rows.Count, "AN").End(xlUp) _
.Offset(0, 1) = MyNote & " " & Format(Now(), "dd/MM/yyy hh:mm AMPM")
If Target.Value = "Notes_1" Then MsgBoxNotes_1
If Target.Value = "Notes_2" Then MsgBoxNotes_2
If Target.Value = "Notes_3" Then MsgBoxNotes_3
End If
Cancel = True
End If

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cell click on one cell selects 2 or 3 cells? Loken Excel Worksheet Functions 2 January 15th 09 11:02 PM
VB CODE for double click? CAPTGNVR[_2_] Excel Programming 4 April 20th 08 03:44 PM
How do I code a cell to display the current date on double-click? George[_27_] Excel Programming 6 December 10th 06 09:26 AM
How to trigger code in Excel add-in after double-click or right-cl Ferko Excel Programming 2 April 19th 06 08:16 AM
Click on graph bar to execute a double-click in a pivot table cell [email protected] Charts and Charting in Excel 4 August 3rd 05 01:37 AM


All times are GMT +1. The time now is 02:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"