|
楼主 |
发表于 2012-7-25 15:51
|
显示全部楼层
gdsgzhrsh 发表于 2012-7-25 14:49
Sub 本月()
Dim aa%, HH$, BB%
For aa = 10 To 54 Step 4
‘老师你好!帮我把这代码改到模块中
Private Sub Worksheet_Change(ByVal Target As Range)
Dim I As Long
On Error Resume Next
With Target.Parent
If Target.Cells.Count = 1 Then
If Target.Column = 5 And Target.Row = 10 Then
Application.EnableEvents = False
I = 17
.Cells(13, 5) = Target.Value
Do While I <= 57
If Len(.Cells(I - 3, 5).Value) Then
If IsNumeric(.Cells(I - 3, 5).Value) Then
.Cells(I, 5).Value = .Cells(I - 3, 5).Value + .Cells(I - 4, 5).Value
End If
End If
I = I + 4
Loop
Application.EnableEvents = True
End If
End If
End With
End Sub
|
|