作者:怪话greenup | 来源:互联网 | 2023-10-11 10:16
这个问题,我们只能用VBA来解决了首先按alt+F11,打开宏VBA编辑器,将下面代码复制过去就OK了1:PrivateSubWorksheet_Change(ByVal
这个问题,我们只能用VBA来解决了
首先按alt+F11,打开宏VBA编辑器,将下面代码复制过去就OK了
1: Private Sub Worksheet_Change(ByVal Target As Range)
2: If Not IsNumeric(Target) Then End
3:
4: '第一种方案
5: If Not Application.Intersect(Target, Range("A1:A10")) Is Nothing Then
'把A1和A10改成你需要的就OK了
6: Application.EnableEvents = False
7: Target = Target * 6
8: Application.EnableEvents = True
9: End If
10:
11: '第二种方案
12: If Not Application.Intersect(Target, Range("B1:B10")) Is Nothing Then
'把A1和A10改成你需要的就OK了
13: Application.EnableEvents = False
14: Target = Target * 4
15: Application.EnableEvents = True
16: End If
17:
18: End Sub
19: