AW: Text in Autoformen(Shapes) suche
10.03.2021 09:45:21
Alexandro
Danke für die Hilfe davor,
nun kommt bei mir was ganz komisches.
Sobald ich ein neues Shape reinfüge funkt er nicht. Egal. ob ich funktionierende Shapes ausschneide oder kopiere und einfüge, funktionieren dies nicht. bzw. das Programm sucht und findet sie nicht.
Das Programm sucht nach Shapes und gibt diese aus in der Zelle links oben TopLeftCell.
Das Fettgedruckte gibt dann den Fehler "Objekt unterstützt diese Eigenschaft oder Methode nicht."
Ich wäre für jede Hilfe sehr dankbar!
Grüße
Alexandro
Sub searchInForms()
Dim objShp As Shape, objWS As Worksheet
Dim strSearch As String
strSearch = Range("A3").Value
If strSearch "" Then
For Each objWS In ThisWorkbook.Worksheets
For Each objShp In objWS.Shapes
With objShp
Debug.Print .Type
If .Type msoFormControl Then
If InStr(1, .TextFrame.Characters.Text, strSearch, vbTextCompare) _
Then
Application.Goto .TopLeftCell, True
If MsgBox("Weitersuchen?", vbYesNo) = vbNo Then Exit Sub
End If
End If
End With
Next
Next
End If
End Sub