一年级加减法运算VB实现Excel运行

Private Sub CommandButton1_Click()
    Dim x, y As Integer
    x = TextBox1.Value
    y = TextBox2.Value
    For i = 5 To 24
        For j = 1 To 23 Step 6
            firstVal = Application.WorksheetFunction.RandBetween(x, y)
            Sheet1.Cells(i, j) = firstVal "给A,G,M,S列填充x-y之间的数值
            "判断运算符单选框的值并填充到运算符列,并填写第二个运算数
            Select Case True
                 Case OptionButton1.Value
                    If CheckBox2.Value = True Then
                    
                    
                      Sheet1.Cells(i, j + 1) = "+"
                      secondVal = Application.WorksheetFunction.RandBetween(x, y)
                      Sheet1.Cells(i, j + 4) = firstVal + secondVal
                      If CheckBox1.Value = True Then
                          Sheet1.Cells(i, j + 2) = Sheet1.Cells(i, j + 4).Value - Sheet1.Cells(i, j).Value
                      Else
                          Sheet1.Cells(i, j + 2) = ""
                      End If
                    
                    Else
                      Sheet1.Cells(i, j + 1) = "+"
                      secondVal = Application.WorksheetFunction.RandBetween(x, y)
                      Sheet1.Cells(i, j + 2) = secondVal
                      If CheckBox1.Value = True Then
                          Sheet1.Cells(i, j + 4) = Sheet1.Cells(i, j).Value + Sheet1.Cells(i, j + 2).Value
                      Else
                          Sheet1.Cells(i, j + 4) = ""
                      End If
                    End If
                 Case OptionButton2.Value
                    Sheet1.Cells(i, j + 1) = "-"
                    Sheet1.Cells(i, j + 2) = Application.WorksheetFunction.RandBetween(x, Sheet1.Cells(i, j))
                    If CheckBox1.Value = True Then
                        Sheet1.Cells(i, j + 4) = Sheet1.Cells(i, j).Value - Sheet1.Cells(i, j + 2).Value
                    Else
                        Sheet1.Cells(i, j + 4) = ""
                    End If
                 Case Else
                    If Application.WorksheetFunction.RandBetween(0, 1) = 0 Then
                        Sheet1.Cells(i, j + 1) = "+"
                        Sheet1.Cells(i, j + 2) = Application.WorksheetFunction.RandBetween(x, y)
                        If CheckBox1.Value = True Then
                            Sheet1.Cells(i, j + 4) = Sheet1.Cells(i, j).Value + Sheet1.Cells(i, j + 2).Value
                        Else
                            Sheet1.Cells(i, j + 4) = ""
                        End If
                    Else
                        Sheet1.Cells(i, j + 1) = "-"
                        Sheet1.Cells(i, j + 2) = Application.WorksheetFunction.RandBetween(x, Sheet1.Cells(i, j))
                        If CheckBox1.Value = True Then
                            Sheet1.Cells(i, j + 4) = Sheet1.Cells(i, j).Value - Sheet1.Cells(i, j + 2).Value
                        Else
                            Sheet1.Cells(i, j + 4) = ""
                        End If
                    End If
            End Select
            Sheet1.Cells(i, j + 3) = "="
        Next
        
    Next
    
   
    
End Sub