For a = -2.1 To 2.1 Step 0.35
For b = -2.1 To 2.1 Step 0.35
For c = -2.1 To 2.1 Step 0.35
For d = -2.1 To 2.1 Step 0.35
For e = -2.1 To 2.1 Step 0.35
Var = Var + 1
For LOOP_CASE = 1 To 177
Matrix(LOOP_CASE, 1+Var*5-5) = Round(3*(ADS.Value(LOOP_CASE, 73)+c)+2*(ADS.Value(LOOP_CASE, 72)+b)-(ADS.Value(LOOP_CASE, 74)+d)-3*(ADS.Value(LOOP_CASE, 71)+a)-3*(ADS.Value(LOOP_CASE, 75)+e),0)
Matrix(LOOP_CASE, 2+Var*5-5) = Round(2*(ADS.Value(LOOP_CASE, 71)+a) + 0.2*(ADS.Value(LOOP_CASE, 74)+d) - (ADS.Value(LOOP_CASE, 72)+b) - (ADS.Value(LOOP_CASE, 73)+c) - (ADS.Value(LOOP_CASE, 75)+e),0)
Matrix(LOOP_CASE, 3+Var*5-5) = Round(2*(ADS.Value(LOOP_CASE, 75)+e) + 2*(ADS.Value(LOOP_CASE, 71)+a) + (ADS.Value(LOOP_CASE, 74)+d) - 0.1*(ADS.Value(LOOP_CASE, 72)+b) - 2*(ADS.Value(LOOP_CASE, 73)+c),0)
Matrix(LOOP_CASE, 4+Var*5-5) = Round((ADS.Value(LOOP_CASE, 73)+c) + (ADS.Value(LOOP_CASE, 75)+e) + 0.1*(ADS.Value(LOOP_CASE, 72)+b) - 0.5*(ADS.Value(LOOP_CASE, 74)+d) - (ADS.Value(LOOP_CASE, 71)+a),0)
Matrix(LOOP_CASE, 5+Var*5-5) = Round(3*(ADS.Value(LOOP_CASE, 73)+c) + 1.2*(ADS.Value(LOOP_CASE, 74)+d) - 0.2*(ADS.Value(LOOP_CASE, 72)+b) - 2*(ADS.Value(LOOP_CASE, 71)+a) - 3*(ADS.Value(LOOP_CASE, 75)+e),0)
Next LOOP_CASE
Next e
Next d
Next c
Next b
Next a
'--------------------Frequency analysis and putting results into the spreadsheet------------------
For b = -25 To 60
v = v+1
For LOOP_CASE = 1 To 177
For LOOP_VAR = 1 To 13^5*5
If Matrix (LOOP_CASE, LOOP_VAR) = b Then k=k+1
Next LOOP_VAR
Spreadsheet.Value (LOOP_CASE, v) = k
k=0
Next LOOP_CASE
Next b
v=0