bin absoluter VBA-Anfänger.
Habe das Problem, dass ich eine bestehende Datei anpassen muss.
Nun hab ich es zumindest geschafft, die Zeile oben einzufügen anstatt unten. Jedoch übernimmt er mir nicht das Format von unten sondern von oben.
Was genau muss im Befehl geändert werden?
Dank an alle, die hier helfen können.
Sub Zeile_einfügen()
Dim PBN As Integer
Application.ScreenUpdating = False
Sheets("Aktivitäten").Select
ActiveSheet.Unprotect
'Problemblattnummer holen
Application.Goto Reference:="Problemblattnummer"
PBN = Cells(Selection.Row, Selection.Column).Value
'Zeile einfügen
Application.Goto Reference:="Nr."
Rows("8:8").Select
'Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.EntireRow.Insert 'CopyOrigin:=xlFormatFromLeftOrAbove
'Problemblattnummer setzen
Cells(Selection.Row, 1).Value = PBN
'Status auf "0" setzen
Cells(Selection.Row, 3).Value = "Prozessproblem"
'Status auf "0" setzen
Cells(Selection.Row, 13).Value = "0"
'Format von oberer Zeile übernehmen und Höhe anpassen
ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select
Selection.Copy
ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:= _
_
False
Application.CutCopyMode = False
Selection.Locked = False
Selection.FormulaHidden = False
Selection.Font.Bold = False
ActiveCell.Rows("5:5").EntireRow.RowHeight = 60
Application.ScreenUpdating = True
End Sub