Option
Explicit
Public
Sub
test()
Dim
objCell
As
Range
For
Each
objCell
In
Range(Cells(6, 1), Cells(5000, 1))
If
objCell.DisplayFormat.Interior.Color = vbGreen
Then
Exit
For
Next
If
objCell
Is
Nothing
Then
Call
MsgBox(Prompt:=
"Markierung nicht vorhanden, "
& _
"Spalte wird nicht gelöscht...!"
, Buttons:=vbExclamation)
Else
If
MsgBox(Prompt:=
"Markierung gefunden, möchten Sie die Spalte wirklich löschen..?"
, _
Buttons:=vbQuestion + vbYesNo) = vbYes
Then
_
Call
objCell.EntireColumn.Delete
Set
objCell =
Nothing
End
If
End
Sub