| 
    
     |  | ▼shouw さん: 
 >
 >B6セル以降がデータが入るようになっており、行挿入及び最新データはB6セルに入るようになっています。
 
 >その新たに挿入された最新データ及び今までのデータの平均値をB4セル内に表示するようにしたいのです。
 
 なるほど、それなら分かります。
 [B4]セルは固定なのですね
 
 Private Sub Worksheet_Change(ByVal Target As Range)
 Dim r As Range
 If Target.Count = 1 Then Exit Sub
 Set r = Intersect(Target, Rows(6)) '6行目が挿入されたら
 If r Is Nothing Then Exit Sub
 
 Application.EnableEvents = False
 Set r = Range("B6", Cells(Rows.Count, "B").End(xlUp))
 Range("B4").Formula = "=Average(" & r.Address & ")"
 Application.EnableEvents = True
 End Sub
 
 
 |  |