Vereinfachen
03.12.2008 13:25:15
gp
ich habe folgenden Code
If Metereingabe.TextBox14.Value = "1" Then
Tabelle1.Cells(7, 3) = Metereingabe.ComboBox1.Value
Tabelle1.Cells(7, 4) = Metereingabe.ComboBox2.Value
Tabelle1.Cells(7, 5) = Metereingabe.ComboBox3.Value
Tabelle1.Cells(7, 6) = Metereingabe.TextBox13.Value
Tabelle1.Cells(7, 7) = Metereingabe.ComboBox5.Value
Tabelle1.Cells(7, 8) = Metereingabe.ComboBox6.Value
Tabelle1.Cells(7, 9) = Metereingabe.ComboBox7.Value
Tabelle1.CommandButton1.BackColor = &H80FF&
End If
If Metereingabe.TextBox14.Value = "2" Then
Tabelle1.Cells(8, 3) = Metereingabe.ComboBox1.Value
Tabelle1.Cells(8, 4) = Metereingabe.ComboBox2.Value
Tabelle1.Cells(8, 5) = Metereingabe.ComboBox3.Value
Tabelle1.Cells(8, 6) = Metereingabe.TextBox13.Value
Tabelle1.Cells(8, 7) = Metereingabe.ComboBox5.Value
Tabelle1.Cells(8, 8) = Metereingabe.ComboBox6.Value
Tabelle1.Cells(8, 9) = Metereingabe.ComboBox7.Value
Tabelle1.CommandButton2.BackColor = &H80FF&
End If
insgesamt zwanzig mal (Textbox14.Value geht bis 20 und Tabelle1.Cells(von7 bis 26)).
Nun möchte ich das Ganze in einer Schleife vereinfachen und hab keine Ahnung wie ich das schreiben muss.
Für zweckdienliche Hinweise herzlichen Dank.
Gruss
Gunter