|  
                                             Das hier ist mein Code: 
Sub Insertrowbelow() 
'updateby Extendoffice 
Worksheets("Budgetplanung").Activate 
    Dim i As Long 
    Dim xLast As Long 
    Dim xRng As Range 
    Dim xTxt As String 
    On Error Resume Next 
    xTxt = Application.ActiveWindow.RangeSelection.Address 
    Set xRng = Application.InputBox("Bitte Spalte auswählen, in die die Leerzeilen eingefügt werden sollen:", "Kutools for Excel", xTxt, , , , , 8) 
    If xRng Is Nothing Then Exit Sub 
    If (xRng.Columns.Count > 1) Then 
        MsgBox "Bitte wählen Sie maximal eine Spalte aus", , "Kutools for Excel" 
        Exit Sub 
    End If 
    xLast = xRng.Rows.Count 
    For i = xLast To 1 Step -1 
      If InStr(1, xRng.Cells(i, 1).Value, "Paket") > 0 Then 
        Rows(xRng.Cells(i + 1, 1).Row).Insert Shift:=xlDown 
        End If 
        If InStr(1, xRng.Cells(i, 1).Value, "Paket") > 0 Then 
        Rows(xRng.Cells(i + 1, 1).Row).Insert Shift:=xlDown 
        End If 
        If InStr(1, xRng.Cells(i, 1).Value, "Paket") > 0 Then 
        Rows(xRng.Cells(i + 1, 1).Row).Insert Shift:=xlDown 
        End If 
        If InStr(1, xRng.Cells(i, 1).Value, "Paket") > 0 Then 
        Rows(xRng.Cells(i + 1, 1).Row).Insert Shift:=xlDown 
        End If 
        If InStr(1, xRng.Cells(i, 1).Value, "Paket") > 0 Then 
        Rows(xRng.Cells(i + 1, 1).Row).Insert Shift:=xlDown 
        End If 
        If InStr(1, xRng.Cells(i, 1).Value, "Paket") > 0 Then 
        Rows(xRng.Cells(i + 1, 1).Row).Insert Shift:=xlDown 
        End If 
        If InStr(1, xRng.Cells(i, 1).Value, "Paket") > 0 Then 
        Rows(xRng.Cells(i + 1, 1).Row).Insert Shift:=xlDown 
        End If 
     
    Next 
End Sub 
  
Wo würde ich das mit eintragen, wenn ich direkt in den Leerzeilen die Kostenart miteingefügt haben möchte? 
     |