|
やりたいことがいまいちよくわからないのですが、
こんな感じでいかがでしょう。
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x As String
x = Range("A65536").End(xlUp).Row
With Target
If IsEmpty(.Value) Then Exit Sub
If .Count > 1 Then Exit Sub
If .Column = 2 Or .Column = 5 Or .Column = 8 Then
Application.EnableEvents = False
For i = 1 To x
If Cells(i, 2).Value <> "" And Cells(i, 5).Value <> "" _
And Cells(i, 8).Value <> "" Then
Cells(i, 3).Value = Round(Cells(i, 1) - Cells(i, 2), 2)
Cells(i, 6).Value = Round(Cells(i, 4) * Cells(i, 5), 2)
Cells(i, 9).Value = Round(Cells(i, 7) / Cells(i, 8), 2)
End If
Next
Application.EnableEvents = True
End If
End With
End Sub
|
|