Double click fails to run the code, just selects the cell
Hi Howard,
Am Sun, 5 May 2013 08:07:19 -0700 (PDT) schrieb Howard:
Cells G14, G36, G58 and G80 should show the input box only if their value when double clicked is either of the strings Notes_1, Notes_2 or Notes_3.
then try:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Intersect(Target, Range("G14,G36,G58,G80")) Is _
Nothing Then Exit Sub
Dim MyIntl As String
Dim MyNote As String
MyNote = Target.Value
Cancel = True
If InStr(Target, "Notes") 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) = Target
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
End Sub
Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
|