I have this code in an excel worksheet which opens a word dcoument when you double click a certain cell (In this instance A1 or A3).
What I would like this code to do is open the doc only if say the text in the cell is red.
Thanks
Vetequk
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim AA As String
Dim AB As String
AA = "$A$1"
AB = "$A$3"
If Target.Address = AA Then
Application.ScreenUpdating = False
Sheets("Attachments").OLEObjects("Object 1").Verb
Me.Activate
Application.ScreenUpdating = True
Cancel = True
ElseIf Target.Address = AB Then
Application.ScreenUpdating = False
Sheets("Attachments").OLEObjects("Object 2").Verb
Me.Activate
Application.ScreenUpdating = True
Cancel = True
End If
End Sub
Bookmarks