| 
    
     |  | こんばんは 
 テキストボックスに入力して実行するのが決めなら、
 
 Private Sub CommandButton1_Click()
 Dim 最大値 As Single
 Dim 最小値 As Single
 Dim i   As Long
 Dim t()  As Single
 i = 0
 If TextBox1.Value <> "" Then
 i = i + 1
 ReDim Preserve t(1 To i)
 t(i) = TextBox1.Value
 End If
 If TextBox2.Value <> "" Then
 i = i + 1
 ReDim Preserve t(1 To i)
 t(i) = TextBox2.Value
 End If
 If TextBox3.Value <> "" Then
 i = i + 1
 ReDim Preserve t(1 To i)
 t(i) = TextBox3.Value
 End If
 
 If i > 0 Then
 最大値 = Application.Max(t)
 最小値 = Application.Min(t)
 
 'テキストボックス4の計算
 TextBox4.Value = (最大値 + 最小値) / 2
 
 '整数のみ表示
 TextBox4.Value = Fix(TextBox4.Value)
 End If
 
 End Sub
 
 こんな感じでも。
 
 
 |  |