Avatar billede mvhansen Nybegynder
19. oktober 2010 - 11:22 Der er 6 kommentarer og
1 løsning

hvordan kan jeg lave denne vba kode korter med checkbox og optionbutton

Hej

Jeg får en fejl hvis min vba kode er så lang

Fejl jeg får er:

Compile error:
Procedure too large



Private Sub CommandButton1_Click()
Worksheets("Condition").Activate
If CheckBox1 And OptionButton1 Then
TextBox1 = Range("D8").Value
TextBox2 = Range("E8").Value
TextBox3 = Range("c8").Value
Else

If CheckBox2 And OptionButton1 Then
TextBox1 = Range("F8").Value
TextBox2 = Range("G8").Value
TextBox3 = Range("c8").Value
Else

If CheckBox3 And OptionButton1 Then
TextBox1 = Range("H8").Value
TextBox2 = Range("I8").Value
TextBox3 = Range("c8").Value
Else

If CheckBox4 And OptionButton1 Then
TextBox1 = Range("J8").Value
TextBox2 = Range("K8").Value
TextBox3 = Range("c8").Value
Else

If CheckBox5 And OptionButton1 Then
TextBox1 = Range("L8").Value
TextBox2 = Range("M8").Value
TextBox3 = Range("c8").Value
Else

If CheckBox6 And OptionButton1 Then
TextBox1 = Range("N8").Value
TextBox2 = Range("O8").Value
TextBox3 = Range("c8").Value
Else
'-------------------------------------------------------
If CheckBox1 And OptionButton2 Then
TextBox1 = Range("D9").Value
TextBox2 = Range("E9").Value
TextBox3 = Range("c9").Value
Else

If CheckBox2 And OptionButton2 Then
TextBox1 = Range("F9").Value
TextBox2 = Range("G9").Value
TextBox3 = Range("c9").Value
Else

If CheckBox3 And OptionButton2 Then
TextBox1 = Range("H9").Value
TextBox2 = Range("I9").Value
TextBox3 = Range("c9").Value
Else

If CheckBox4 And OptionButton2 Then
TextBox1 = Range("J9").Value
TextBox2 = Range("K9").Value
TextBox3 = Range("c9").Value
Else

If CheckBox5 And OptionButton2 Then
TextBox1 = Range("L9").Value
TextBox2 = Range("M9").Value
TextBox3 = Range("c9").Value
Else

If CheckBox6 And OptionButton2 Then
TextBox1 = Range("N9").Value
TextBox2 = Range("O9").Value
TextBox3 = Range("c9").Value
Else
'---------------------------------------------------------
If CheckBox1 And OptionButton3 Then
TextBox1 = Range("D10").Value
TextBox2 = Range("E10").Value
TextBox3 = Range("c10").Value
Else

If CheckBox2 And OptionButton3 Then
TextBox1 = Range("F10").Value
TextBox2 = Range("G10").Value
TextBox3 = Range("c10").Value
Else

If CheckBox3 And OptionButton3 Then
TextBox1 = Range("H10").Value
TextBox2 = Range("I10").Value
TextBox3 = Range("c10").Value
Else

If CheckBox4 And OptionButton3 Then
TextBox1 = Range("J10").Value
TextBox2 = Range("K10").Value
TextBox3 = Range("c10").Value
Else

If CheckBox5 And OptionButton3 Then
TextBox1 = Range("L10").Value
TextBox2 = Range("M10").Value
TextBox3 = Range("c10").Value
Else

If CheckBox6 And OptionButton3 Then
TextBox1 = Range("N10").Value
TextBox2 = Range("O10").Value
TextBox3 = Range("c10").Value
Else
'---------------------------------------------------------
If CheckBox1 And OptionButton4 Then
TextBox1 = Range("D11").Value
TextBox2 = Range("E11").Value
TextBox3 = Range("c11").Value
Else

If CheckBox2 And OptionButton4 Then
TextBox1 = Range("F11").Value
TextBox2 = Range("G11").Value
TextBox3 = Range("c11").Value
Else

If CheckBox3 And OptionButton4 Then
TextBox1 = Range("H11").Value
TextBox2 = Range("I11").Value
TextBox3 = Range("c11").Value
Else

If CheckBox4 And OptionButton4 Then
TextBox1 = Range("J11").Value
TextBox2 = Range("K11").Value
TextBox3 = Range("c11").Value
Else

If CheckBox5 And OptionButton4 Then
TextBox1 = Range("L11").Value
TextBox2 = Range("M11").Value
TextBox3 = Range("c11").Value
Else

If CheckBox6 And OptionButton4 Then
TextBox1 = Range("N11").Value
TextBox2 = Range("O11").Value
TextBox3 = Range("c11").Value
Else
'------------------------------------------------------------

If CheckBox1 And OptionButton5 Then
TextBox1 = Range("D12").Value
TextBox2 = Range("E12").Value
TextBox3 = Range("c12").Value
Else

If CheckBox2 And OptionButton5 Then
TextBox1 = Range("F12").Value
TextBox2 = Range("G12").Value
TextBox3 = Range("c12").Value
Else

If CheckBox3 And OptionButton5 Then
TextBox1 = Range("H12").Value
TextBox2 = Range("I12").Value
TextBox3 = Range("c12").Value
Else

If CheckBox4 And OptionButton5 Then
TextBox1 = Range("J12").Value
TextBox2 = Range("K12").Value
TextBox3 = Range("c12").Value
Else

If CheckBox5 And OptionButton5 Then
TextBox1 = Range("L12").Value
TextBox2 = Range("M12").Value
TextBox3 = Range("c12").Value
Else

If CheckBox6 And OptionButton5 Then
TextBox1 = Range("N12").Value
TextBox2 = Range("O12").Value
TextBox3 = Range("c12").Value
Else
'----------------------------------------------------------------

If CheckBox1 And OptionButton6 Then
TextBox1 = Range("D13").Value
TextBox2 = Range("E13").Value
TextBox3 = Range("c13").Value
Else

If CheckBox2 And OptionButton6 Then
TextBox1 = Range("F13").Value
TextBox2 = Range("G13").Value
TextBox3 = Range("c13").Value
Else

If CheckBox3 And OptionButton6 Then
TextBox1 = Range("H13").Value
TextBox2 = Range("I13").Value
TextBox3 = Range("c13").Value
Else

If CheckBox4 And OptionButton6 Then
TextBox1 = Range("J13").Value
TextBox2 = Range("K13").Value
TextBox3 = Range("c13").Value
Else

If CheckBox5 And OptionButton6 Then
TextBox1 = Range("L13").Value
TextBox2 = Range("M13").Value
TextBox3 = Range("c13").Value
Else

If CheckBox6 And OptionButton6 Then
TextBox1 = Range("N13").Value
TextBox2 = Range("O13").Value
TextBox3 = Range("c13").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton7 Then
TextBox1 = Range("D15").Value
TextBox2 = Range("E15").Value
TextBox3 = Range("c15").Value
Else

If CheckBox2 And OptionButton7 Then
TextBox1 = Range("F15").Value
TextBox2 = Range("G15").Value
TextBox3 = Range("c15").Value
Else

If CheckBox3 And OptionButton7 Then
TextBox1 = Range("H15").Value
TextBox2 = Range("I15").Value
TextBox3 = Range("c15").Value
Else

If CheckBox4 And OptionButton7 Then
TextBox1 = Range("J15").Value
TextBox2 = Range("K15").Value
TextBox3 = Range("c15").Value
Else

If CheckBox5 And OptionButton7 Then
TextBox1 = Range("L15").Value
TextBox2 = Range("M15").Value
TextBox3 = Range("c15").Value
Else

If CheckBox6 And OptionButton7 Then
TextBox1 = Range("N15").Value
TextBox2 = Range("O15").Value
TextBox3 = Range("c15").Value
Else
'--------------------------------------------------------------------

If CheckBox1 And OptionButton8 Then
TextBox1 = Range("D16").Value
TextBox2 = Range("E16").Value
TextBox3 = Range("c16").Value
Else

If CheckBox2 And OptionButton8 Then
TextBox1 = Range("F16").Value
TextBox2 = Range("G16").Value
TextBox3 = Range("c16").Value
Else

If CheckBox3 And OptionButton8 Then
TextBox1 = Range("H16").Value
TextBox2 = Range("I16").Value
TextBox3 = Range("c16").Value
Else

If CheckBox4 And OptionButton8 Then
TextBox1 = Range("J16").Value
TextBox2 = Range("K16").Value
TextBox3 = Range("c16").Value
Else

If CheckBox5 And OptionButton8 Then
TextBox1 = Range("L16").Value
TextBox2 = Range("M16").Value
TextBox3 = Range("c16").Value
Else

If CheckBox6 And OptionButton8 Then
TextBox1 = Range("N16").Value
TextBox2 = Range("O16").Value
TextBox3 = Range("c16").Value
Else
'--------------------------------------------------------------------

If CheckBox1 And OptionButton9 Then
TextBox1 = Range("D19").Value
TextBox2 = Range("E19").Value
TextBox3 = Range("c19").Value
Else

If CheckBox2 And OptionButton9 Then
TextBox1 = Range("F19").Value
TextBox2 = Range("G19").Value
TextBox3 = Range("c19").Value
Else

If CheckBox3 And OptionButton9 Then
TextBox1 = Range("H19").Value
TextBox2 = Range("I19").Value
TextBox3 = Range("c19").Value
Else

If CheckBox4 And OptionButton9 Then
TextBox1 = Range("J19").Value
TextBox2 = Range("K19").Value
TextBox3 = Range("c19").Value
Else

If CheckBox5 And OptionButton9 Then
TextBox1 = Range("L19").Value
TextBox2 = Range("M19").Value
TextBox3 = Range("c19").Value
Else

If CheckBox6 And OptionButton9 Then
TextBox1 = Range("N19").Value
TextBox2 = Range("O19").Value
TextBox3 = Range("c19").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton10 Then
TextBox1 = Range("D20").Value
TextBox2 = Range("E20").Value
TextBox3 = Range("c20").Value
Else

If CheckBox2 And OptionButton10 Then
TextBox1 = Range("F20").Value
TextBox2 = Range("G20").Value
TextBox3 = Range("c20").Value
Else

If CheckBox3 And OptionButton10 Then
TextBox1 = Range("H20").Value
TextBox2 = Range("I20").Value
TextBox3 = Range("c20").Value
Else

If CheckBox4 And OptionButton10 Then
TextBox1 = Range("J20").Value
TextBox2 = Range("K20").Value
TextBox3 = Range("c20").Value
Else

If CheckBox5 And OptionButton10 Then
TextBox1 = Range("L20").Value
TextBox2 = Range("M20").Value
TextBox3 = Range("c20").Value
Else

If CheckBox6 And OptionButton10 Then
TextBox1 = Range("N20").Value
TextBox2 = Range("O20").Value
TextBox3 = Range("c20").Value
Else
'--------------------------------------------------------------------

If CheckBox1 And OptionButton11 Then
TextBox1 = Range("D21").Value
TextBox2 = Range("E21").Value
TextBox3 = Range("c21").Value
Else

If CheckBox2 And OptionButton11 Then
TextBox1 = Range("F21").Value
TextBox2 = Range("G21").Value
TextBox3 = Range("c21").Value
Else

If CheckBox3 And OptionButton11 Then
TextBox1 = Range("H21").Value
TextBox2 = Range("I21").Value
TextBox3 = Range("c21").Value
Else

If CheckBox4 And OptionButton11 Then
TextBox1 = Range("J21").Value
TextBox2 = Range("K21").Value
TextBox3 = Range("c21").Value
Else

If CheckBox5 And OptionButton11 Then
TextBox1 = Range("L21").Value
TextBox2 = Range("M21").Value
TextBox3 = Range("c21").Value
Else

If CheckBox6 And OptionButton11 Then
TextBox1 = Range("N21").Value
TextBox2 = Range("O21").Value
TextBox3 = Range("c21").Value
Else
'--------------------------------------------------------------------

If CheckBox1 And OptionButton12 Then
TextBox1 = Range("D22").Value
TextBox2 = Range("E22").Value
TextBox3 = Range("c22").Value
Else

If CheckBox2 And OptionButton12 Then
TextBox1 = Range("F22").Value
TextBox2 = Range("G22").Value
TextBox3 = Range("c22").Value
Else

If CheckBox3 And OptionButton12 Then
TextBox1 = Range("H22").Value
TextBox2 = Range("I22").Value
TextBox3 = Range("c22").Value
Else

If CheckBox4 And OptionButton12 Then
TextBox1 = Range("J22").Value
TextBox2 = Range("K22").Value
TextBox3 = Range("c22").Value
Else

If CheckBox5 And OptionButton12 Then
TextBox1 = Range("L22").Value
TextBox2 = Range("M22").Value
TextBox3 = Range("c22").Value
Else

If CheckBox6 And OptionButton12 Then
TextBox1 = Range("N22").Value
TextBox2 = Range("O22").Value
TextBox3 = Range("c22").Value
Else
'--------------------------------------------------------------------

If CheckBox1 And OptionButton13 Then
TextBox1 = Range("D23").Value
TextBox2 = Range("E23").Value
TextBox3 = Range("c23").Value
Else

If CheckBox2 And OptionButton13 Then
TextBox1 = Range("F23").Value
TextBox2 = Range("G23").Value
TextBox3 = Range("c23").Value
Else

If CheckBox3 And OptionButton13 Then
TextBox1 = Range("H23").Value
TextBox2 = Range("I23").Value
TextBox3 = Range("c23").Value
Else

If CheckBox4 And OptionButton13 Then
TextBox1 = Range("J23").Value
TextBox2 = Range("K23").Value
TextBox3 = Range("c23").Value
Else

If CheckBox5 And OptionButton13 Then
TextBox1 = Range("L23").Value
TextBox2 = Range("M23").Value
TextBox3 = Range("c23").Value
Else

If CheckBox6 And OptionButton13 Then
TextBox1 = Range("N23").Value
TextBox2 = Range("O23").Value
TextBox3 = Range("c23").Value
Else
'--------------------------------------------------------------------

If CheckBox1 And OptionButton14 Then
TextBox1 = Range("D24").Value
TextBox2 = Range("E24").Value
TextBox3 = Range("c24").Value
Else

If CheckBox2 And OptionButton14 Then
TextBox1 = Range("F24").Value
TextBox2 = Range("G24").Value
TextBox3 = Range("c24").Value
Else

If CheckBox3 And OptionButton14 Then
TextBox1 = Range("H24").Value
TextBox2 = Range("I24").Value
TextBox3 = Range("c24").Value
Else

If CheckBox4 And OptionButton14 Then
TextBox1 = Range("J24").Value
TextBox2 = Range("K24").Value
TextBox3 = Range("c24").Value
Else

If CheckBox5 And OptionButton14 Then
TextBox1 = Range("L24").Value
TextBox2 = Range("M24").Value
TextBox3 = Range("c24").Value
Else

If CheckBox6 And OptionButton14 Then
TextBox1 = Range("N24").Value
TextBox2 = Range("O24").Value
TextBox3 = Range("c24").Value
Else
'--------------------------------------------------------------------

If CheckBox1 And OptionButton15 Then
TextBox1 = Range("D25").Value
TextBox2 = Range("E25").Value
TextBox3 = Range("c25").Value
Else

If CheckBox2 And OptionButton15 Then
TextBox1 = Range("F25").Value
TextBox2 = Range("G25").Value
TextBox3 = Range("c25").Value
Else

If CheckBox3 And OptionButton15 Then
TextBox1 = Range("H25").Value
TextBox2 = Range("I25").Value
TextBox3 = Range("c25").Value
Else

If CheckBox4 And OptionButton15 Then
TextBox1 = Range("J25").Value
TextBox2 = Range("K25").Value
TextBox3 = Range("c25").Value
Else

If CheckBox5 And OptionButton15 Then
TextBox1 = Range("L25").Value
TextBox2 = Range("M25").Value
TextBox3 = Range("c25").Value
Else

If CheckBox6 And OptionButton15 Then
TextBox1 = Range("N25").Value
TextBox2 = Range("O25").Value
TextBox3 = Range("c25").Value
Else

'--------------------------------------------------------------------

If CheckBox1 And OptionButton16 Then
TextBox1 = Range("D26").Value
TextBox2 = Range("E26").Value
TextBox3 = Range("c26").Value
Else

If CheckBox2 And OptionButton16 Then
TextBox1 = Range("F26").Value
TextBox2 = Range("G26").Value
TextBox3 = Range("c26").Value
Else

If CheckBox3 And OptionButton16 Then
TextBox1 = Range("H26").Value
TextBox2 = Range("I26").Value
TextBox3 = Range("c26").Value
Else

If CheckBox4 And OptionButton16 Then
TextBox1 = Range("J26").Value
TextBox2 = Range("K26").Value
TextBox3 = Range("c26").Value
Else

If CheckBox5 And OptionButton16 Then
TextBox1 = Range("L26").Value
TextBox2 = Range("M26").Value
TextBox3 = Range("c26").Value
Else

If CheckBox6 And OptionButton16 Then
TextBox1 = Range("N26").Value
TextBox2 = Range("O26").Value
TextBox3 = Range("c26").Value
Else
'--------------------------------------------------------------------

If CheckBox1 And OptionButton17 Then
TextBox1 = Range("D27").Value
TextBox2 = Range("E27").Value
TextBox3 = Range("c27").Value
Else

If CheckBox2 And OptionButton17 Then
TextBox1 = Range("F27").Value
TextBox2 = Range("G27").Value
TextBox3 = Range("c27").Value
Else

If CheckBox3 And OptionButton17 Then
TextBox1 = Range("H27").Value
TextBox2 = Range("I27").Value
TextBox3 = Range("c27").Value
Else

If CheckBox4 And OptionButton17 Then
TextBox1 = Range("J27").Value
TextBox2 = Range("K27").Value
TextBox3 = Range("c27").Value
Else

If CheckBox5 And OptionButton17 Then
TextBox1 = Range("L27").Value
TextBox2 = Range("M27").Value
TextBox3 = Range("c27").Value
Else

If CheckBox6 And OptionButton17 Then
TextBox1 = Range("N27").Value
TextBox2 = Range("O27").Value
TextBox3 = Range("c27").Value
Else
'--------------------------------------------------------------------

If CheckBox1 And OptionButton18 Then
TextBox1 = Range("D28").Value
TextBox2 = Range("E28").Value
TextBox3 = Range("c28").Value
Else

If CheckBox2 And OptionButton18 Then
TextBox1 = Range("F28").Value
TextBox2 = Range("G28").Value
TextBox3 = Range("c28").Value
Else

If CheckBox3 And OptionButton18 Then
TextBox1 = Range("H28").Value
TextBox2 = Range("I28").Value
TextBox3 = Range("c28").Value
Else

If CheckBox4 And OptionButton18 Then
TextBox1 = Range("J28").Value
TextBox2 = Range("K28").Value
TextBox3 = Range("c28").Value
Else

If CheckBox5 And OptionButton18 Then
TextBox1 = Range("L28").Value
TextBox2 = Range("M28").Value
TextBox3 = Range("c28").Value
Else

If CheckBox6 And OptionButton18 Then
TextBox1 = Range("N28").Value
TextBox2 = Range("O28").Value
TextBox3 = Range("c28").Value
Else
'--------------------------------------------------------------------

If CheckBox1 And OptionButton19 Then
TextBox1 = Range("D29").Value
TextBox2 = Range("E29").Value
TextBox3 = Range("c29").Value
Else

If CheckBox2 And OptionButton19 Then
TextBox1 = Range("F29").Value
TextBox2 = Range("G29").Value
TextBox3 = Range("c29").Value
Else

If CheckBox3 And OptionButton19 Then
TextBox1 = Range("H29").Value
TextBox2 = Range("I29").Value
TextBox3 = Range("c29").Value
Else

If CheckBox4 And OptionButton19 Then
TextBox1 = Range("J29").Value
TextBox2 = Range("K29").Value
TextBox3 = Range("c29").Value
Else

If CheckBox5 And OptionButton19 Then
TextBox1 = Range("L29").Value
TextBox2 = Range("M29").Value
TextBox3 = Range("c29").Value
Else

If CheckBox6 And OptionButton19 Then
TextBox1 = Range("N29").Value
TextBox2 = Range("O29").Value
TextBox3 = Range("c29").Value
Else
'--------------------------------------------------------------------

If CheckBox1 And OptionButton20 Then
TextBox1 = Range("D30").Value
TextBox2 = Range("E30").Value
TextBox3 = Range("c30").Value
Else

If CheckBox2 And OptionButton20 Then
TextBox1 = Range("F30").Value
TextBox2 = Range("G30").Value
TextBox3 = Range("c30").Value
Else

If CheckBox3 And OptionButton20 Then
TextBox1 = Range("H30").Value
TextBox2 = Range("I30").Value
TextBox3 = Range("c30").Value
Else

If CheckBox4 And OptionButton20 Then
TextBox1 = Range("J30").Value
TextBox2 = Range("K30").Value
TextBox3 = Range("c30").Value
Else

If CheckBox5 And OptionButton20 Then
TextBox1 = Range("L30").Value
TextBox2 = Range("M30").Value
TextBox3 = Range("c30").Value
Else

If CheckBox6 And OptionButton20 Then
TextBox1 = Range("N30").Value
TextBox2 = Range("O30").Value
TextBox3 = Range("c30").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton21 Then
TextBox1 = Range("D31").Value
TextBox2 = Range("E31").Value
TextBox3 = Range("c31").Value
Else

If CheckBox2 And OptionButton21 Then
TextBox1 = Range("F31").Value
TextBox2 = Range("G31").Value
TextBox3 = Range("c31").Value
Else

If CheckBox3 And OptionButton21 Then
TextBox1 = Range("H31").Value
TextBox2 = Range("I31").Value
TextBox3 = Range("c31").Value
Else

If CheckBox4 And OptionButton21 Then
TextBox1 = Range("J31").Value
TextBox2 = Range("K31").Value
TextBox3 = Range("c31").Value
Else

If CheckBox5 And OptionButton21 Then
TextBox1 = Range("L31").Value
TextBox2 = Range("M31").Value
TextBox3 = Range("c31").Value
Else

If CheckBox6 And OptionButton21 Then
TextBox1 = Range("N31").Value
TextBox2 = Range("O31").Value
TextBox3 = Range("c31").Value
Else
'--------------------------------------------------------------------

If CheckBox1 And OptionButton22 Then
TextBox1 = Range("D32").Value
TextBox2 = Range("E32").Value
TextBox3 = Range("c32").Value
Else

If CheckBox2 And OptionButton22 Then
TextBox1 = Range("F32").Value
TextBox2 = Range("G32").Value
TextBox3 = Range("c32").Value
Else

If CheckBox3 And OptionButton22 Then
TextBox1 = Range("H32").Value
TextBox2 = Range("I32").Value
TextBox3 = Range("c32").Value
Else

If CheckBox4 And OptionButton22 Then
TextBox1 = Range("J32").Value
TextBox2 = Range("K32").Value
TextBox3 = Range("c32").Value
Else

If CheckBox5 And OptionButton22 Then
TextBox1 = Range("L32").Value
TextBox2 = Range("M32").Value
TextBox3 = Range("c32").Value
Else

If CheckBox6 And OptionButton22 Then
TextBox1 = Range("N32").Value
TextBox2 = Range("O32").Value
TextBox3 = Range("c32").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton23 Then
TextBox1 = Range("D33").Value
TextBox2 = Range("E33").Value
TextBox3 = Range("c33").Value
Else

If CheckBox2 And OptionButton23 Then
TextBox1 = Range("F33").Value
TextBox2 = Range("G33").Value
TextBox3 = Range("c33").Value
Else

If CheckBox3 And OptionButton23 Then
TextBox1 = Range("H33").Value
TextBox2 = Range("I33").Value
TextBox3 = Range("c33").Value
Else

If CheckBox4 And OptionButton23 Then
TextBox1 = Range("J33").Value
TextBox2 = Range("K33").Value
TextBox3 = Range("c33").Value
Else

If CheckBox5 And OptionButton23 Then
TextBox1 = Range("L33").Value
TextBox2 = Range("M33").Value
TextBox3 = Range("c33").Value
Else

If CheckBox6 And OptionButton23 Then
TextBox1 = Range("N33").Value
TextBox2 = Range("O33").Value
TextBox3 = Range("c33").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton24 Then
TextBox1 = Range("D34").Value
TextBox2 = Range("E34").Value
TextBox3 = Range("c34").Value
Else

If CheckBox2 And OptionButton24 Then
TextBox1 = Range("F34").Value
TextBox2 = Range("G34").Value
TextBox3 = Range("c34").Value
Else

If CheckBox3 And OptionButton24 Then
TextBox1 = Range("H34").Value
TextBox2 = Range("I34").Value
TextBox3 = Range("c34").Value
Else

If CheckBox4 And OptionButton24 Then
TextBox1 = Range("J34").Value
TextBox2 = Range("K34").Value
TextBox3 = Range("c34").Value
Else

If CheckBox5 And OptionButton24 Then
TextBox1 = Range("L34").Value
TextBox2 = Range("M34").Value
TextBox3 = Range("c34").Value
Else

If CheckBox6 And OptionButton24 Then
TextBox1 = Range("N34").Value
TextBox2 = Range("O34").Value
TextBox3 = Range("c34").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton25 Then
TextBox1 = Range("D35").Value
TextBox2 = Range("E35").Value
TextBox3 = Range("c35").Value
Else

If CheckBox2 And OptionButton25 Then
TextBox1 = Range("F35").Value
TextBox2 = Range("G35").Value
TextBox3 = Range("c35").Value
Else

If CheckBox3 And OptionButton25 Then
TextBox1 = Range("H35").Value
TextBox2 = Range("I35").Value
TextBox3 = Range("c35").Value
Else

If CheckBox4 And OptionButton25 Then
TextBox1 = Range("J35").Value
TextBox2 = Range("K35").Value
TextBox3 = Range("c35").Value
Else

If CheckBox5 And OptionButton25 Then
TextBox1 = Range("L35").Value
TextBox2 = Range("M35").Value
TextBox3 = Range("c35").Value
Else

If CheckBox6 And OptionButton25 Then
TextBox1 = Range("N35").Value
TextBox2 = Range("O35").Value
TextBox3 = Range("c35").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton26 Then
TextBox1 = Range("D36").Value
TextBox2 = Range("E36").Value
TextBox3 = Range("c36").Value
Else

If CheckBox2 And OptionButton26 Then
TextBox1 = Range("F36").Value
TextBox2 = Range("G36").Value
TextBox3 = Range("c36").Value
Else

If CheckBox3 And OptionButton26 Then
TextBox1 = Range("H36").Value
TextBox2 = Range("I36").Value
TextBox3 = Range("c36").Value
Else

If CheckBox4 And OptionButton26 Then
TextBox1 = Range("J36").Value
TextBox2 = Range("K36").Value
TextBox3 = Range("c36").Value
Else

If CheckBox5 And OptionButton26 Then
TextBox1 = Range("L36").Value
TextBox2 = Range("M36").Value
TextBox3 = Range("c36").Value
Else

If CheckBox6 And OptionButton26 Then
TextBox1 = Range("N36").Value
TextBox2 = Range("O36").Value
TextBox3 = Range("c36").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton27 Then
TextBox1 = Range("D37").Value
TextBox2 = Range("E37").Value
TextBox3 = Range("c37").Value
Else

If CheckBox2 And OptionButton27 Then
TextBox1 = Range("F37").Value
TextBox2 = Range("G37").Value
TextBox3 = Range("c37").Value
Else

If CheckBox3 And OptionButton27 Then
TextBox1 = Range("H37").Value
TextBox2 = Range("I37").Value
TextBox3 = Range("c37").Value
Else

If CheckBox4 And OptionButton27 Then
TextBox1 = Range("J37").Value
TextBox2 = Range("K37").Value
TextBox3 = Range("c37").Value
Else

If CheckBox5 And OptionButton27 Then
TextBox1 = Range("L37").Value
TextBox2 = Range("M37").Value
TextBox3 = Range("c37").Value
Else

If CheckBox6 And OptionButton27 Then
TextBox1 = Range("N37").Value
TextBox2 = Range("O37").Value
TextBox3 = Range("c37").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton28 Then
TextBox1 = Range("D38").Value
TextBox2 = Range("E38").Value
TextBox3 = Range("c38").Value
Else

If CheckBox2 And OptionButton28 Then
TextBox1 = Range("F38").Value
TextBox2 = Range("G38").Value
TextBox3 = Range("c38").Value
Else

If CheckBox3 And OptionButton28 Then
TextBox1 = Range("H38").Value
TextBox2 = Range("I38").Value
TextBox3 = Range("c38").Value
Else

If CheckBox4 And OptionButton28 Then
TextBox1 = Range("J38").Value
TextBox2 = Range("K38").Value
TextBox3 = Range("c38").Value
Else

If CheckBox5 And OptionButton28 Then
TextBox1 = Range("L38").Value
TextBox2 = Range("M38").Value
TextBox3 = Range("c38").Value
Else

If CheckBox6 And OptionButton28 Then
TextBox1 = Range("N38").Value
TextBox2 = Range("O38").Value
TextBox3 = Range("c38").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton29 Then
TextBox1 = Range("D39").Value
TextBox2 = Range("E39").Value
TextBox3 = Range("c39").Value
Else

If CheckBox2 And OptionButton29 Then
TextBox1 = Range("F39").Value
TextBox2 = Range("G39").Value
TextBox3 = Range("c39").Value
Else

If CheckBox3 And OptionButton29 Then
TextBox1 = Range("H39").Value
TextBox2 = Range("I39").Value
TextBox3 = Range("c39").Value
Else

If CheckBox4 And OptionButton29 Then
TextBox1 = Range("J39").Value
TextBox2 = Range("K39").Value
TextBox3 = Range("c39").Value
Else

If CheckBox5 And OptionButton29 Then
TextBox1 = Range("L39").Value
TextBox2 = Range("M39").Value
TextBox3 = Range("c39").Value
Else

If CheckBox6 And OptionButton29 Then
TextBox1 = Range("N39").Value
TextBox2 = Range("O39").Value
TextBox3 = Range("c39").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton30 Then
TextBox1 = Range("D40").Value
TextBox2 = Range("E40").Value
TextBox3 = Range("c40").Value
Else

If CheckBox2 And OptionButton30 Then
TextBox1 = Range("F40").Value
TextBox2 = Range("G40").Value
TextBox3 = Range("c40").Value
Else

If CheckBox3 And OptionButton30 Then
TextBox1 = Range("H40").Value
TextBox2 = Range("I40").Value
TextBox3 = Range("c40").Value
Else

If CheckBox4 And OptionButton30 Then
TextBox1 = Range("J40").Value
TextBox2 = Range("K40").Value
TextBox3 = Range("c40").Value
Else

If CheckBox5 And OptionButton30 Then
TextBox1 = Range("L40").Value
TextBox2 = Range("M40").Value
TextBox3 = Range("c40").Value
Else

If CheckBox6 And OptionButton30 Then
TextBox1 = Range("N40").Value
TextBox2 = Range("O40").Value
TextBox3 = Range("c40").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton31 Then
TextBox1 = Range("D41").Value
TextBox2 = Range("E41").Value
TextBox3 = Range("c41").Value
Else

If CheckBox2 And OptionButton31 Then
TextBox1 = Range("F41").Value
TextBox2 = Range("G41").Value
TextBox3 = Range("c41").Value
Else

If CheckBox3 And OptionButton31 Then
TextBox1 = Range("H41").Value
TextBox2 = Range("I41").Value
TextBox3 = Range("c41").Value
Else

If CheckBox4 And OptionButton31 Then
TextBox1 = Range("J41").Value
TextBox2 = Range("K41").Value
TextBox3 = Range("c41").Value
Else

If CheckBox5 And OptionButton31 Then
TextBox1 = Range("L41").Value
TextBox2 = Range("M41").Value
TextBox3 = Range("c41").Value
Else

If CheckBox6 And OptionButton31 Then
TextBox1 = Range("N41").Value
TextBox2 = Range("O41").Value
TextBox3 = Range("c41").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton32 Then
TextBox1 = Range("D42").Value
TextBox2 = Range("E42").Value
TextBox3 = Range("c42").Value
Else

If CheckBox2 And OptionButton32 Then
TextBox1 = Range("F42").Value
TextBox2 = Range("G42").Value
TextBox3 = Range("c42").Value
Else

If CheckBox3 And OptionButton32 Then
TextBox1 = Range("H42").Value
TextBox2 = Range("I42").Value
TextBox3 = Range("c42").Value
Else

If CheckBox4 And OptionButton32 Then
TextBox1 = Range("J42").Value
TextBox2 = Range("K42").Value
TextBox3 = Range("c42").Value
Else

If CheckBox5 And OptionButton32 Then
TextBox1 = Range("L42").Value
TextBox2 = Range("M42").Value
TextBox3 = Range("c42").Value
Else

If CheckBox6 And OptionButton32 Then
TextBox1 = Range("N42").Value
TextBox2 = Range("O42").Value
TextBox3 = Range("c42").Value
Else
'--------------------------------------------------------------------

If CheckBox1 And OptionButton33 Then
TextBox1 = Range("D49").Value
TextBox2 = Range("E49").Value
TextBox3 = Range("c49").Value
Else

If CheckBox2 And OptionButton33 Then
TextBox1 = Range("F49").Value
TextBox2 = Range("G49").Value
TextBox3 = Range("c49").Value
Else

If CheckBox3 And OptionButton33 Then
TextBox1 = Range("H49").Value
TextBox2 = Range("I49").Value
TextBox3 = Range("c49").Value
Else

If CheckBox4 And OptionButton33 Then
TextBox1 = Range("J49").Value
TextBox2 = Range("K49").Value
TextBox3 = Range("c49").Value
Else

If CheckBox5 And OptionButton33 Then
TextBox1 = Range("L49").Value
TextBox2 = Range("M49").Value
TextBox3 = Range("c49").Value
Else

If CheckBox6 And OptionButton33 Then
TextBox1 = Range("N49").Value
TextBox2 = Range("O49").Value
TextBox3 = Range("c49").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton34 Then
TextBox1 = Range("D50").Value
TextBox2 = Range("E50").Value
TextBox3 = Range("c50").Value
Else

If CheckBox2 And OptionButton34 Then
TextBox1 = Range("F50").Value
TextBox2 = Range("G50").Value
TextBox3 = Range("c50").Value
Else

If CheckBox3 And OptionButton34 Then
TextBox1 = Range("H50").Value
TextBox2 = Range("I50").Value
TextBox3 = Range("c50").Value
Else

If CheckBox4 And OptionButton34 Then
TextBox1 = Range("J50").Value
TextBox2 = Range("K50").Value
TextBox3 = Range("c50").Value
Else

If CheckBox5 And OptionButton34 Then
TextBox1 = Range("L50").Value
TextBox2 = Range("M50").Value
TextBox3 = Range("c50").Value
Else

If CheckBox6 And OptionButton34 Then
TextBox1 = Range("N50").Value
TextBox2 = Range("O50").Value
TextBox3 = Range("c50").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton35 Then
TextBox1 = Range("D51").Value
TextBox2 = Range("E51").Value
TextBox3 = Range("c51").Value
Else

If CheckBox2 And OptionButton35 Then
TextBox1 = Range("F51").Value
TextBox2 = Range("G51").Value
TextBox3 = Range("c51").Value
Else

If CheckBox3 And OptionButton35 Then
TextBox1 = Range("H51").Value
TextBox2 = Range("I51").Value
TextBox3 = Range("c51").Value
Else

If CheckBox4 And OptionButton35 Then
TextBox1 = Range("J51").Value
TextBox2 = Range("K51").Value
TextBox3 = Range("c51").Value
Else

If CheckBox5 And OptionButton35 Then
TextBox1 = Range("L51").Value
TextBox2 = Range("M51").Value
TextBox3 = Range("c51").Value
Else

If CheckBox6 And OptionButton35 Then
TextBox1 = Range("N51").Value
TextBox2 = Range("O51").Value
TextBox3 = Range("c51").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton36 Then
TextBox1 = Range("D52").Value
TextBox2 = Range("E52").Value
TextBox3 = Range("c52").Value
Else

If CheckBox2 And OptionButton36 Then
TextBox1 = Range("F52").Value
TextBox2 = Range("G52").Value
TextBox3 = Range("c52").Value
Else

If CheckBox3 And OptionButton36 Then
TextBox1 = Range("H52").Value
TextBox2 = Range("I52").Value
TextBox3 = Range("c52").Value
Else

If CheckBox4 And OptionButton36 Then
TextBox1 = Range("J52").Value
TextBox2 = Range("K52").Value
TextBox3 = Range("c52").Value
Else

If CheckBox5 And OptionButton36 Then
TextBox1 = Range("L52").Value
TextBox2 = Range("M52").Value
TextBox3 = Range("c52").Value
Else

If CheckBox6 And OptionButton36 Then
TextBox1 = Range("N52").Value
TextBox2 = Range("O52").Value
TextBox3 = Range("c52").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton37 Then
TextBox1 = Range("D53").Value
TextBox2 = Range("E53").Value
TextBox3 = Range("c53").Value
Else

If CheckBox2 And OptionButton37 Then
TextBox1 = Range("F53").Value
TextBox2 = Range("G53").Value
TextBox3 = Range("c53").Value
Else

If CheckBox3 And OptionButton37 Then
TextBox1 = Range("H53").Value
TextBox2 = Range("I53").Value
TextBox3 = Range("c53").Value
Else

If CheckBox4 And OptionButton37 Then
TextBox1 = Range("J53").Value
TextBox2 = Range("K53").Value
TextBox3 = Range("c53").Value
Else

If CheckBox5 And OptionButton37 Then
TextBox1 = Range("L53").Value
TextBox2 = Range("M53").Value
TextBox3 = Range("c53").Value
Else

If CheckBox6 And OptionButton37 Then
TextBox1 = Range("N53").Value
TextBox2 = Range("O53").Value
TextBox3 = Range("c53").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton38 Then
TextBox1 = Range("D54").Value
TextBox2 = Range("E54").Value
TextBox3 = Range("c54").Value
Else

If CheckBox2 And OptionButton38 Then
TextBox1 = Range("F54").Value
TextBox2 = Range("G54").Value
TextBox3 = Range("c54").Value
Else

If CheckBox3 And OptionButton38 Then
TextBox1 = Range("H54").Value
TextBox2 = Range("I54").Value
TextBox3 = Range("c54").Value
Else

If CheckBox4 And OptionButton38 Then
TextBox1 = Range("J54").Value
TextBox2 = Range("K54").Value
TextBox3 = Range("c54").Value
Else

If CheckBox5 And OptionButton38 Then
TextBox1 = Range("L54").Value
TextBox2 = Range("M54").Value
TextBox3 = Range("c54").Value
Else

If CheckBox6 And OptionButton38 Then
TextBox1 = Range("N54").Value
TextBox2 = Range("O54").Value
TextBox3 = Range("c54").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton39 Then
TextBox1 = Range("D55").Value
TextBox2 = Range("E55").Value
TextBox3 = Range("c55").Value
Else

If CheckBox2 And OptionButton39 Then
TextBox1 = Range("F55").Value
TextBox2 = Range("G55").Value
TextBox3 = Range("c55").Value
Else

If CheckBox3 And OptionButton39 Then
TextBox1 = Range("H55").Value
TextBox2 = Range("I55").Value
TextBox3 = Range("c55").Value
Else

If CheckBox4 And OptionButton39 Then
TextBox1 = Range("J55").Value
TextBox2 = Range("K55").Value
TextBox3 = Range("c55").Value
Else

If CheckBox5 And OptionButton39 Then
TextBox1 = Range("L55").Value
TextBox2 = Range("M55").Value
TextBox3 = Range("c55").Value
Else

If CheckBox6 And OptionButton39 Then
TextBox1 = Range("N55").Value
TextBox2 = Range("O55").Value
TextBox3 = Range("c55").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton40 Then
TextBox1 = Range("D56").Value
TextBox2 = Range("E56").Value
TextBox3 = Range("c56").Value
Else

If CheckBox2 And OptionButton40 Then
TextBox1 = Range("F56").Value
TextBox2 = Range("G56").Value
TextBox3 = Range("c56").Value
Else

If CheckBox3 And OptionButton40 Then
TextBox1 = Range("H56").Value
TextBox2 = Range("I56").Value
TextBox3 = Range("c56").Value
Else

If CheckBox4 And OptionButton40 Then
TextBox1 = Range("J56").Value
TextBox2 = Range("K56").Value
TextBox3 = Range("c56").Value
Else

If CheckBox5 And OptionButton40 Then
TextBox1 = Range("L56").Value
TextBox2 = Range("M56").Value
TextBox3 = Range("c56").Value
Else

If CheckBox6 And OptionButton40 Then
TextBox1 = Range("N56").Value
TextBox2 = Range("O56").Value
TextBox3 = Range("c56").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton41 Then
TextBox1 = Range("D57").Value
TextBox2 = Range("E57").Value
TextBox3 = Range("c57").Value
Else

If CheckBox2 And OptionButton41 Then
TextBox1 = Range("F57").Value
TextBox2 = Range("G57").Value
TextBox3 = Range("c57").Value
Else

If CheckBox3 And OptionButton41 Then
TextBox1 = Range("H57").Value
TextBox2 = Range("I57").Value
TextBox3 = Range("c57").Value
Else

If CheckBox4 And OptionButton41 Then
TextBox1 = Range("J57").Value
TextBox2 = Range("K57").Value
TextBox3 = Range("c57").Value
Else

If CheckBox5 And OptionButton41 Then
TextBox1 = Range("L57").Value
TextBox2 = Range("M57").Value
TextBox3 = Range("c57").Value
Else

If CheckBox6 And OptionButton41 Then
TextBox1 = Range("N57").Value
TextBox2 = Range("O57").Value
TextBox3 = Range("c57").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton42 Then
TextBox1 = Range("D58").Value
TextBox2 = Range("E58").Value
TextBox3 = Range("c58").Value
Else

If CheckBox2 And OptionButton42 Then
TextBox1 = Range("F58").Value
TextBox2 = Range("G58").Value
TextBox3 = Range("c58").Value
Else

If CheckBox3 And OptionButton42 Then
TextBox1 = Range("H58").Value
TextBox2 = Range("I58").Value
TextBox3 = Range("c58").Value
Else

If CheckBox4 And OptionButton42 Then
TextBox1 = Range("J58").Value
TextBox2 = Range("K58").Value
TextBox3 = Range("c58").Value
Else

If CheckBox5 And OptionButton42 Then
TextBox1 = Range("L58").Value
TextBox2 = Range("M58").Value
TextBox3 = Range("c58").Value
Else

If CheckBox6 And OptionButton42 Then
TextBox1 = Range("N58").Value
TextBox2 = Range("O58").Value
TextBox3 = Range("c58").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton43 Then
TextBox1 = Range("D59").Value
TextBox2 = Range("E59").Value
TextBox3 = Range("c59").Value
Else

If CheckBox2 And OptionButton43 Then
TextBox1 = Range("F59").Value
TextBox2 = Range("G59").Value
TextBox3 = Range("c59").Value
Else

If CheckBox3 And OptionButton43 Then
TextBox1 = Range("H59").Value
TextBox2 = Range("I59").Value
TextBox3 = Range("c59").Value
Else

If CheckBox4 And OptionButton43 Then
TextBox1 = Range("J59").Value
TextBox2 = Range("K59").Value
TextBox3 = Range("c59").Value
Else

If CheckBox5 And OptionButton43 Then
TextBox1 = Range("L59").Value
TextBox2 = Range("M59").Value
TextBox3 = Range("c59").Value
Else

If CheckBox6 And OptionButton43 Then
TextBox1 = Range("N59").Value
TextBox2 = Range("O59").Value
TextBox3 = Range("c59").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton44 Then
TextBox1 = Range("D60").Value
TextBox2 = Range("E60").Value
TextBox3 = Range("c60").Value
Else

If CheckBox2 And OptionButton44 Then
TextBox1 = Range("F60").Value
TextBox2 = Range("G60").Value
TextBox3 = Range("c60").Value
Else

If CheckBox3 And OptionButton44 Then
TextBox1 = Range("H60").Value
TextBox2 = Range("I60").Value
TextBox3 = Range("c60").Value
Else

If CheckBox4 And OptionButton44 Then
TextBox1 = Range("J60").Value
TextBox2 = Range("K60").Value
TextBox3 = Range("c60").Value
Else

If CheckBox5 And OptionButton44 Then
TextBox1 = Range("L60").Value
TextBox2 = Range("M60").Value
TextBox3 = Range("c60").Value
Else

If CheckBox6 And OptionButton44 Then
TextBox1 = Range("N60").Value
TextBox2 = Range("O60").Value
TextBox3 = Range("c60").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton45 Then
TextBox1 = Range("D61").Value
TextBox2 = Range("E61").Value
TextBox3 = Range("c61").Value
Else

If CheckBox2 And OptionButton45 Then
TextBox1 = Range("F61").Value
TextBox2 = Range("G61").Value
TextBox3 = Range("c61").Value
Else

If CheckBox3 And OptionButton45 Then
TextBox1 = Range("H61").Value
TextBox2 = Range("I61").Value
TextBox3 = Range("c61").Value
Else

If CheckBox4 And OptionButton45 Then
TextBox1 = Range("J61").Value
TextBox2 = Range("K61").Value
TextBox3 = Range("c61").Value
Else

If CheckBox5 And OptionButton45 Then
TextBox1 = Range("L61").Value
TextBox2 = Range("M61").Value
TextBox3 = Range("c61").Value
Else

If CheckBox6 And OptionButton45 Then
TextBox1 = Range("N61").Value
TextBox2 = Range("O61").Value
TextBox3 = Range("c61").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton46 Then
TextBox1 = Range("D62").Value
TextBox2 = Range("E62").Value
TextBox3 = Range("c62").Value
Else

If CheckBox2 And OptionButton46 Then
TextBox1 = Range("F62").Value
TextBox2 = Range("G62").Value
TextBox3 = Range("c62").Value
Else

If CheckBox3 And OptionButton46 Then
TextBox1 = Range("H62").Value
TextBox2 = Range("I62").Value
TextBox3 = Range("c62").Value
Else

If CheckBox4 And OptionButton46 Then
TextBox1 = Range("J62").Value
TextBox2 = Range("K62").Value
TextBox3 = Range("c62").Value
Else

If CheckBox5 And OptionButton46 Then
TextBox1 = Range("L62").Value
TextBox2 = Range("M62").Value
TextBox3 = Range("c62").Value
Else

If CheckBox6 And OptionButton46 Then
TextBox1 = Range("N62").Value
TextBox2 = Range("O62").Value
TextBox3 = Range("c62").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton47 Then
TextBox1 = Range("D63").Value
TextBox2 = Range("E63").Value
TextBox3 = Range("c63").Value
Else

If CheckBox2 And OptionButton47 Then
TextBox1 = Range("F63").Value
TextBox2 = Range("G63").Value
TextBox3 = Range("c63").Value
Else

If CheckBox3 And OptionButton47 Then
TextBox1 = Range("H63").Value
TextBox2 = Range("I63").Value
TextBox3 = Range("c63").Value
Else

If CheckBox4 And OptionButton47 Then
TextBox1 = Range("J63").Value
TextBox2 = Range("K63").Value
TextBox3 = Range("c63").Value
Else

If CheckBox5 And OptionButton47 Then
TextBox1 = Range("L63").Value
TextBox2 = Range("M63").Value
TextBox3 = Range("c63").Value
Else

If CheckBox6 And OptionButton47 Then
TextBox1 = Range("N63").Value
TextBox2 = Range("O63").Value
TextBox3 = Range("c63").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton48 Then
TextBox1 = Range("D64").Value
TextBox2 = Range("E64").Value
TextBox3 = Range("c64").Value
Else

If CheckBox2 And OptionButton48 Then
TextBox1 = Range("F64").Value
TextBox2 = Range("G64").Value
TextBox3 = Range("c64").Value
Else

If CheckBox3 And OptionButton48 Then
TextBox1 = Range("H64").Value
TextBox2 = Range("I64").Value
TextBox3 = Range("c64").Value
Else

If CheckBox4 And OptionButton48 Then
TextBox1 = Range("J64").Value
TextBox2 = Range("K64").Value
TextBox3 = Range("c64").Value
Else

If CheckBox5 And OptionButton48 Then
TextBox1 = Range("L64").Value
TextBox2 = Range("M64").Value
TextBox3 = Range("c64").Value
Else

If CheckBox6 And OptionButton48 Then
TextBox1 = Range("N64").Value
TextBox2 = Range("O64").Value
TextBox3 = Range("c64").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton49 Then
TextBox1 = Range("D65").Value
TextBox2 = Range("E65").Value
TextBox3 = Range("c65").Value
Else

If CheckBox2 And OptionButton49 Then
TextBox1 = Range("F65").Value
TextBox2 = Range("G65").Value
TextBox3 = Range("c65").Value
Else

If CheckBox3 And OptionButton49 Then
TextBox1 = Range("H65").Value
TextBox2 = Range("I65").Value
TextBox3 = Range("c65").Value
Else

If CheckBox4 And OptionButton49 Then
TextBox1 = Range("J65").Value
TextBox2 = Range("K65").Value
TextBox3 = Range("c65").Value
Else

If CheckBox5 And OptionButton49 Then
TextBox1 = Range("L65").Value
TextBox2 = Range("M65").Value
TextBox3 = Range("c65").Value
Else

If CheckBox6 And OptionButton49 Then
TextBox1 = Range("N65").Value
TextBox2 = Range("O65").Value
TextBox3 = Range("c65").Value
Else
'--------------------------------------------------------------------
If CheckBox1 And OptionButton50 Then
TextBox1 = Range("D66").Value
TextBox2 = Range("E66").Value
TextBox3 = Range("c66").Value
Else

If CheckBox2 And OptionButton50 Then
TextBox1 = Range("F66").Value
TextBox2 = Range("G66").Value
TextBox3 = Range("c66").Value
Else

If CheckBox3 And OptionButton50 Then
TextBox1 = Range("H66").Value
TextBox2 = Range("I66").Value
TextBox3 = Range("c66").Value
Else

If CheckBox4 And OptionButton50 Then
TextBox1 = Range("J66").Value
TextBox2 = Range("K66").Value
TextBox3 = Range("c66").Value
Else

If CheckBox5 And OptionButton50 Then
TextBox1 = Range("L66").Value
TextBox2 = Range("M66").Value
TextBox3 = Range("c42").Value
Else

If CheckBox6 And OptionButton50 Then
TextBox1 = Range("N66").Value
TextBox2 = Range("O66").Value
TextBox3 = Range("c66").Value
Else
'--------------------------------------------------------------------






End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If


End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If


End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End If
End If
End If
End If
End If
End If

End Sub
Avatar billede kabbak Professor
19. oktober 2010 - 12:09 #1
Private Sub CommandButton1_Click()
    Dim Kol As Integer, Rk As Integer
    Worksheets("Condition").Activate
    If OptionButton1 Then Rk = 8
    If OptionButton2 Then Rk = 9
    If OptionButton3 Then Rk = 10
    ' Skriv selv værdien for resten af OptionButton her, det er det samme som rækkenummeret
   
        If CheckBox1 Then Kol = 4
        If CheckBox2 Then Kol = 6
        If CheckBox3 Then Kol = 8
        If CheckBox4 Then Kol = 10
        If CheckBox5 Then Kol = 12
        If CheckBox6 Then Kol = 14
       
        TextBox1 = Cells(Rk, Kol).Value
        TextBox2 = Cells(Rk, Kol + 1).Value
        TextBox3 = Cells(Rk, "c").Value
 
End Sub
Avatar billede komputerdk Mester
19. oktober 2010 - 12:14 #2
mangler der ikke noget

If CheckBox1 And OptionButton1 Then

bør det ikke være  ???
If CheckBox1=TRUE And OptionButton1=TRUE Then

anyway - jeg tror det er fordi din if sætning bliver for kompleks..

prøv i stedet at afgrænse din IF blokke.. jeg tror ikke en select Case vil gøre tricket..

If CheckBox1 And OptionButton1 Then
TextBox1 = Range("D8").Value
TextBox2 = Range("E8").Value
TextBox3 = Range("c8").Value
GOTO exit 'den hopper til exit
End if

...

:exit
'Du kan lave noget kode her.
end sub
Avatar billede mvhansen Nybegynder
19. oktober 2010 - 12:43 #3
Tak for hjælpen kabbak

mvh
mvhansen
Avatar billede mvhansen Nybegynder
19. oktober 2010 - 14:22 #4
Hej kabbak

Jeg har et lille problem hvis OptionButton & CheckBox ikke er vinkel af, så får jeg en fejl.
jeg har prøvet med
     
        If OptionButton1 = False Then
  MsgBox "Du skal vælge en fræser"
ElseIf CheckBox1  = False Then
  MsgBox "Du skal vælger matriale"

Det virker også på OptionButton1 & CheckBox1
Kan man ikke gøre det på dem allesammen,uden at skal skrive på dem allesammen.


      If OptionButton1-50 = False Then
  MsgBox "Du skal vælge en fræser"
ElseIf CheckBox1-6  = False Then
  MsgBox "Du skal vælger matriale"

Men det virker ikke

mvh

mvhansen
Avatar billede kabbak Professor
19. oktober 2010 - 15:16 #5
Dim Kol As Integer, Rk As Integer
    Rk = 0
    Kol = 0
    Worksheets("Condition").Activate
    If OptionButton1 Then Rk = 8
    If OptionButton2 Then Rk = 9
    If OptionButton3 Then Rk = 10
    ' Skriv selv værdien for resten af OptionButton her, det er det samme som rækkenummeret

    If CheckBox1 Then Kol = 4
    If CheckBox2 Then Kol = 6
    If CheckBox3 Then Kol = 8
    If CheckBox4 Then Kol = 10
    If CheckBox5 Then Kol = 12
    If CheckBox6 Then Kol = 14
    '****************** fejlfanger start ****************
    If Rk = 0 Then
        MsgBox "Du skal vælge en fræser"
        Exit Sub
    End If
    If Kol = 0 Then
        MsgBox "Du skal vælger matriale"
        Exit Sub
    End If
    '****************** fejlfanger slut ****************

    TextBox1 = Cells(Rk, Kol).Value
    TextBox2 = Cells(Rk, Kol + 1).Value
    TextBox3 = Cells(Rk, "c").Value
End Sub
Avatar billede kabbak Professor
19. oktober 2010 - 15:17 #6
fik ikke lige 1. linje med, men du kan se hvor fejlfangeren er

husk også de 2 linjer med
    Rk = 0
    Kol = 0
Avatar billede mvhansen Nybegynder
19. oktober 2010 - 15:31 #7
Hej kabbak

Tak skal du have

mvh
mvhansen
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi har et stort udvalg af Excel kurser. Find lige det kursus der passer dig lige her.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester