sub colorSum()Dim s as long,r as RangeFor Each r n Range("亮掘B2:B18")If r. Interior. Color=vbRed Then s=r. offset(,-1).Value+s End IfNext r[C1]="颜色敬键核求和为:亮蔽"[C2]=sEnd sub