dポイントプレゼントキャンペーン実施中!

Excelの図形の中に記載したテキストを検索する事は可能ですか

A 回答 (2件)

VBAでよければ、



Sub sample()
Call ShapeText_Search("検索文字列")
End Sub

Sub ShapeText_Search(SearchText As String)
Dim Shp As Shape
Dim ShapeText As String
Dim pos As Long
For Each Shp In ActiveSheet.Shapes
If Shp.TextFrame2.HasText = msoTrue Then
ShapeText = Shp.TextFrame2.TextRange.Text
pos = InStr(ShapeText, SearchText)

If pos <> 0 Then
MsgBox ("図形名:" & Shp.Name & " の" & pos & "文字目以降に有ります")
End If

End If
Next
End Sub
(グループ化図形未対応)
    • good
    • 0

マクロを使えば可能です。


https://daitaideit.com/vba-shapes-search/
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!