Private Sub calculate_Click()
Dim x
Dim i&
ReDim A(0 To ListBox1.ListCount - 1)
For i = 0 To ListBox1.ListCount - 1: A(i) = ListBox1.List(i, 1): Next
If Me.OptionButton1.Value = True Then TextBox1.Value = WorksheetFunction.max(A)
If Me.OptionButton2.Value = True Then TextBox1.Value = WorksheetFunction.min(A)
If Me.OptionButton3.Value = True Then
For i = 0 To UBound(A)
If A(i) < 4000 Then x = A(i)
Next
TextBox1.Value = x
End If
End Sub
HelloThis appears to be exactly the same as this question, but from a different user account. Please explain.
No, just the opposite, I'm here because of a desperate situation for a long time already trying to create this form, and after I received the answer everything cleared up.Then I will respectfully suggest that you are not going to learn much by simply getting other people to do your work...
ThanksHi
And welcome
Not sure if I well understand your request
Try
VBA Code:Private Sub calculate_Click() Dim x Dim i& ReDim A(0 To ListBox1.ListCount - 1) For i = 0 To ListBox1.ListCount - 1: A(i) = ListBox1.List(i, 1): Next If Me.OptionButton1.Value = True Then TextBox1.Value = WorksheetFunction.max(A) If Me.OptionButton2.Value = True Then TextBox1.Value = WorksheetFunction.min(A) If Me.OptionButton3.Value = True Then For i = 0 To UBound(A) If A(i) < 4000 Then x = A(i) Next TextBox1.Value = x End If End Sub