Clever-Excel-Forum

Normale Version: Array Formeln mit VBA koiperen und einfügen
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Hallo zusammen werte VBA Experten,

ich ahbe eine Tabelle, über die ich per VBA Zeilen kopieren, einfügen und den Namen umbennen, lasse. 

In diesem ganz speziellen Code Schnippsel passiert genau das. Es ist aber nur eines von 5 Arrays die surchlaufen. Aber bei diesem brauche ich noch Hilfe. 

Ich muss hier Array (Matrix) Formeln kopieren und original wieder einfügen. Klappt aber niht. Wie könnte das funktionieren?

Code:
Private Sub UploadSchreiben()
    Dim arrIn(), arrTmp(), rngGruppe As Range, iZeile&, newName$, i&, j&
   
    For i = 0 To UBound(arrUpload)
        If ComboBox1 = "" Then Exit Sub
        If ComboBox2 = "" Then Exit Sub
        If TextBox1 = "" Then Exit Sub
        With Sheets(arrUpload(i))
            Set rngGruppe = .Columns(1).Find(ComboBox2.Value, LookAt:=xlWhole)
            If Not rngGruppe Is Nothing Then
                arrTmp = .Range(.Cells(rngGruppe.Row, 2), .Cells(rngGruppe.Row, 40)).FormulaR1C1
            End If
            Set rngGruppe = .Columns(1).Find(ComboBox2.Value, LookAt:=xlWhole)
            If Not rngGruppe Is Nothing Then
                .Rows(rngGruppe.Row + 1).Insert
                .Cells(rngGruppe.Row + 1, 1) = .Cells(rngGruppe.Row, 3)
                .Cells(rngGruppe.Row + 1, 1) = TextBox1
                For j = 1 To UBound(arrTmp, 2)
                    .Cells(rngGruppe.Row + 1, 1 + j) = arrTmp(1, j)
                Next j
            End If
        End With
    Next i
End Sub

Ich hoffe das Ihr helfen könnt

VG
Hallo,

Code:
                For j = 1 To UBound(arrTmp, 2)
                    .Cells(rngGruppe.Row + 1, 1 + j).FormulaR1C1 = arrTmp(1, j)
                Next j

Gruß Uwe