| 
 
 | 
 
 
发表于 2018-11-22 18:07
来自手机
|显示全部楼层
 
 
 
此文章由 yuankiki 原创或转贴,不代表本站立场和观点,版权归  oursteps.com.au 和作者 yuankiki 所有!转贴必须注明作者、出处和本声明,并保持内容完整 
 
5 
6 
7 
8 
9 
Option Explicit 
  
Private Sub Worksheet_SelectionChange(ByVal Target As Range) 
    If Selection.Count = 1 Then 
        If Not Intersect(Target, Range("D4")) Is Nothing Then 
            Call MyMacro 
        End If 
    End If 
End Sub 
 
1. In the code, D4 is the cell you will click to run Macro; 
 
2. Please replace the code name MyMacro with the Macro you will run in the worksheet.  
 
——source from Google. 网上大把例子,google一下就有了 |   
 
 
 
 |