Ich habe eine Tabelle mit 18 Spalten (A bis R). Nun möchte ich dass unterhalb der aktivierten Zeile eine neue leere Zeile eingefügt wird. Dabei sollen jedoch die Formeln in den Spalten H und K übernommen werden.
Kann mir jemand helfen?
Sub Macro3(control As IRibbonControl)
'Zeile einfügen
Dim iCount As Integer
With Selection
iCount = .Rows.Count
Rows(.Row + iCount & ":" & _
.Row + (iCount * 2) - 1).Rows.Insert
End With
End Sub
Komischerweise wird die Formel von Spalte H übernommen, jedoch jene von Spalte K nicht.Private Sub CommandButton1_Click()
Intersect(Range("A:R"), ActiveCell.EntireRow).Offset(1).Insert Shift:=xlDown
Cells(ActiveCell.Row + 1, "H").Formula = Cells(ActiveCell.Row, "H").Formula
Cells(ActiveCell.Row + 1, "K").Formula = Cells(ActiveCell.Row, "K").Formula
End Sub