Hallo,
das ist doch Quatsch. Nutze zum Schreiben der Formel in die Zellen die FormulaR1C1 Methode, lasse die entsprechenden Spalten auf Relativ, dann wird die Formel doch automatsich an die jeweilige Spalte angepasst.
Public Sub aaa()
If OptionButton6 = True Then
If K_Comparison.ComboBox3 = "" Then 'keine Eingabe in Art Nr
MsgBox ("not valid!")
Exit Sub
Else
Range("F7:J7").NumberFormat = "General" 'Inhalt als Text Formatieren
Range("F6:J6").NumberFormat = "General" 'Inhalt als Text Formatieren
With Sheets("Comparison")
.Cells(7, 4).Value = K_Comparison.ComboBox3 'Produkt eintragen
.Cells(7, 6).Value = K_Comparison.ComboBox4.Value
.Cells(7, 7).Value = K_Comparison.ComboBox5.Value
.Cells(7, 8).Value = K_Comparison.ComboBox6.Value 'H7
.Cells(7, 9).Value = K_Comparison.ComboBox7.Value 'I7
.Cells(7, 10).Value = K_Comparison.ComboBox8.Value 'J7
.Range(.Cells(6, 6), .Cells(6, 10)).FormulaR1C1 = _
"=IFERROR(IF(R7C=0,0,INDEX(Marktuebersicht!C1:C42,MATCH(R7C,Marktuebersicht!C3,0),R6C2)),0)"
End With
End If
End If
End Sub
Gruß Werner
|