通过双击特定单元格来调用子单元(例如(“(O1”))

时间:2016-05-12 04:55:00

标签: excel-vba vba excel

通过双击特定单元格(例如(“O1”))提供调用子代码的代码。

这是我的代码,它不起作用: -

Public Sub Worksheet_BeforeDoubleClick(ByVal target As Range, _
                                        Cancel As Boolean)

If Intersect(target, Range("O1")) Is Nothing Then

 Else
   Call OpenSupport2Tool
End If
 End Sub

1 个答案:

答案 0 :(得分:0)

Public Sub Worksheet_BeforeDoubleClick(ByVal target As Range, Cancel As Boolean)

If Not Intersect(target, Range("O1")) Is Nothing Then
   Call OpenSupport2Tool
   Cancel = True
End If

End Sub