一个excel工作簿里面有多个工作表,针对一张表,写了一个代码,现在想把这个代码运用到每一个表中,但是宏的代码不会写,请哪位大咖帮忙解决下。代码如下所示:
Private Sub Worksheet_Change(ByVal TargetAs Range) If Target.Column = 3 And Target.Count = 1Then If IsNumeric(Target.Value) = True Then Application.EnableEvents = False Target = Target.Value / 100 Application.EnableEvents = True End If End If If Target.Column = 8 And Target.Count = 1Then If IsNumeric(Target.Value) = True Then Application.EnableEvents = False Target = Target.Value / 100 Application.EnableEvents = True End If End If If Target.Column = 9 And Target.Count = 1Then If IsNumeric(Target.Value) = True Then Application.EnableEvents = False Target = Target.Value / 100 Application.EnableEvents = True End If End If If Target.Column = 10 And Target.Count = 1Then If IsNumeric(Target.Value) = True Then Application.EnableEvents = False Target = Target.Value / 100 Application.EnableEvents = True End If End If End Sub
|