Probleme mit Shapes.Select
25.05.2008 11:04:35
Mister
folgendes Makro will nicht wie ich es will!
Sub SaveStats()
Dim SavePath As String
Dim AWS As String
Application.DisplayAlerts = False
Application.ScreenUpdating = False
With Worksheets("Statistik")
.Unprotect
.Copy
ActiveSheet.Shapes("CommandButton1").Select
Selection.Cut
End With
SavePath = "X:\A-Ost\Statistik\" & "Monatsstatistik - " _
& Format(Date, "mmmm yyyy") & ".xls"
ActiveWorkbook.SaveAs Filename:=SavePath
AWS = ActiveWorkbook.FullName
ActiveWorkbook.Close
Sheets("Startseite").Select
End Sub
Die Tabelle "Statistik" wird kopiert und der vorhandene Button "CommandButton1" soll gelöscht werden. Die neue Tabelle ohne CommandButton soll dann gespeichert werden. Es funktioniert alles nur der CommandButton wird nicht gelöscht. Was habe ich falsch gemacht?
Gruß
Martin