wer kann weiterhelfen:
Ein Bild ist in Zelle a26 eingefügt, wie kann dieses automatisch über VBA gelöscht werden?
Danke für Eure Hilfe
Marcus
Private Sub CommandButton2_Click()
With Application
.Calculation = xlAutomatic
.MaxChange = 0.001
ActiveWorkbook.PrecisionAsDisplayed = False
End With
If MsgBox("Alles berechnet!" & Chr(13) & "Richtiges Papier eingelegt?" & Chr(13) & " _
Jetzt drucken?", vbYesNo) = vbNo Then
Exit Sub
Else
If MsgBox("Beidseitigen Druck eingestellt?", vbYesNo) = vbNo Then
Exit Sub
Else
Dim Counter As Integer
Dim n As Integer
Dim Fso As Object
Dim Pic As Picture, Dateiname As String
For Counter = 1 To 770
Worksheets("Stapel auto").Cells(Counter, 9).Value = Counter
If Cells(Counter, 10) = 1 Then
Range("H1") = Cells(Counter, 9)
Set Fso = CreateObject("Scripting.FileSystemObject")
Dateiname = Range("h2").Value
If Fso.FileExists(Dateiname) Then
Set Pic = ActiveSheet.Pictures.Insert(Range("h2").Value)
With ActiveSheet.Range("A26:g56")
Pic.Left = .Left
Pic.Top = .Top
Pic.Width = .Width
Pic.Height = .Height
End With
For i = 1 To Int(Cells(Counter, 14) / 50) + 1
ActiveSheet.PrintOut
Next i
Pic.Select
Selection.Delete
Else
For i = 1 To Int(Cells(Counter, 14) / 50) + 1
ActiveSheet.PrintOut
Next i
End If
End If
n = n - (Cells(Counter, 10) = 1)
Next Counter
MsgBox ("Das war's:" & " " & n & " " & "Stapelanhänger gedruckt")
End If
End If
End Sub