MsgBox mit Abbruch
BerndR
dieses Makro habe ich aus dem Forum und es läuft einwandfrei.
Wie kann ich die MsgBox um einen Abbruch-Button erweitern?
Gruß BerndR
Sub Finden()
Dim rng As Range
Dim vNumber As Variant
Dim iCounter As Integer
Dim sFirst As String
Dim bln As Boolean
vNumber = InputBox( _
prompt:="Bitte Begriff eingeben:", _
Default:="Such Such")
If vNumber = "" Then Exit Sub
For iCounter = 1 To Worksheets.Count
Set rng = Worksheets(iCounter).Cells.Find(vNumber)
If rng Is Nothing = False Then
sFirst = rng.Address
Do
Set rng = Worksheets(iCounter).Cells.FindNext(rng)
MsgBox "Gefunden in Blatt " & rng.Parent.Name _
& " - Zelle " & rng.Address(False, False)
Loop While Not rng Is Nothing And rng.Address sFirst
bln = True
End If
Next iCounter
If bln = False Then
Beep
MsgBox prompt:="Begriff nicht gefunden!"
End
End If
End Sub