Private Sub Command1_Click() Dim b As Integer, a1, a2 As Integer Dim c As Integer '**************************** For b = 0 To 2 If Check1(b).Value = 1 Then c = c + Check1(b) End If Next '*************************** For b = 0 To 2 If c >= 2 Then If Check1(b).Index = 0 Then a1 = 59 ElseIf Check1(b).Index = 1 Then a1 = 60 ElseIf Check1(b).Index = 2 Then a1 = 61 Else End If '*************************************** If Check1(b).Value = 1 Then Dim strText() As String ReDim Preserve strText(0 To c) As String MsgBox c For i = 0 To c strText(i) = Check1(b).Caption Text1.Text = strText(i) & "+" & a1 Next i Else End If '****************************************** ElseIf c < 2 Then '****************************************** If Check1(b).Index = 0 Then a2 = 59 ElseIf Check1(b).Index = 1 Then a2 = 60 ElseIf Check1(b).Index = 2 Then a2 = 61 Else End If '****************************************** If Check1(b).Value = 1 Then ReDim Preserve strText(0 To c) As String For i = 0 To c strText(i) = Check1(b).Caption Text1.Text = strText(i) & "+" & a2 Next i Else End If End If Next '********************************************* End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)