AW: Zeile an Tabelle mit Steuerelement
23.07.2012 16:07:21
UweD
Hallo
so evtl.
Sub TT()
On Error GoTo Fehler
Dim TB1, PW$
Dim SP%, LR&
PW = "ABC" ' anpassen
Set TB1 = Sheets("Tabelle1") 'aus bestimmtem Blatt
SP = 1 'Spalte A
LR = TB1.Cells(Rows.Count, SP).End(xlUp).Row 'letzte Zeile der Spalte
Application.ScreenUpdating = False
ActiveSheet.Unprotect (PW)
With TB1
.Rows(LR + 1).Insert Shift:=xlDown
.Rows(LR).Copy
.Rows(LR + 1).PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
ActiveSheet.Protect Password:=PW, DrawingObjects:=True, Contents:=True, Scenarios:=True
End With
Err.Clear 'nur bei XL 2007 benötigt
Fehler:
If Err.Number 0 Then MsgBox "Fehler: " & Err.Number & vbLf & Err.Description: Err.Clear
Application.EnableEvents = True
Application.DisplayAlerts = True
End Sub
Gruß UweD