Ich versuche mit dem Code eine bestimmte Formel in Zellen eintragen. Ich habe viele Varianten ausprobiert und komme nicht auf den Fehler.
If OptionButton6 = True Then
If K_Comparison.ComboBox3 = "" Then 'keine Eingabe in Art Nr
MsgBox ("not valid!")
Exit Sub
Else
Dim Dormel(10) As Variant
Dim i As Integer
Dim Spal As String
For i = 6 To 10 'Array vollschreiben
If i = 6 Then
Spal = "F"
ElseIf i = 7 Then
Spal = "G"
ElseIf i = 8 Then
Spal = "H"
ElseIf i = 9 Then
Spal = "I"
ElseIf i = 10 Then
Spal = "J"
End If
Dormel(i) = "=WENNFEHLER(WENN(" & Spal "$7=0;0;INDEX(Marktuebersicht!" "$A:$AP;VERGLEICH(" & Spal &"$7;Marktuebersicht!"$C:$C;0);$B6));0)"
Next
Range("F7:J7").NumberFormat = "General" 'Inhalt als Text Formatieren
Range("F6:J6").NumberFormat = "General" 'Inhalt als Text Formatieren
Sheets("Comparison").Cells(7, 4).Value = K_Comparison.ComboBox3 'Produkt eintragen
Sheets("Comparison").Cells(7, 6).Value = K_Comparison.ComboBox4.Value
Sheets("Comparison").Cells(6, 6).Value = Dormel(6)
Sheets("Comparison").Cells(7, 7).Value = K_Comparison.ComboBox5.Value
Sheets("Comparison").Cells(6, 7).Value = Dormel(7)
Sheets("Comparison").Cells(7, 8).Value = K_Comparison.ComboBox6.Value 'H7
Sheets("Comparison").Cells(6, 8).Value = Dormel(8)
Sheets("Comparison").Cells(7, 9).Value = K_Comparison.ComboBox7.Value 'I7
Sheets("Comparison").Cells(6, 9).Value = Dormel(9)
Sheets("Comparison").Cells(7, 10).Value = K_Comparison.ComboBox8.Value 'J7
Sheets("Comparison").Cells(6, 10).Value = Dormel(10)
End If
|