Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
locate shapes with specified text inside
Hi,
Using VBA, is there any way to locate the shape with specified text inside in Excel? thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
locate shapes with specified text inside
Sub DD()
Dim shp As Shape Dim s As String Dim TargetText As String TargetText = "dog" For Each shp In ActiveSheet.Shapes On Error Resume Next s = "" s = shp.TextFrame.Characters.Text On Error GoTo 0 If InStr(1, s, TargetText, vbTextCompare) Then shp.Select Exit For End If Next End Sub -- Regards, Tom Ogilvy "lvcha.gouqizi" wrote in message ups.com... Hi, Using VBA, is there any way to locate the shape with specified text inside in Excel? thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
locate shapes with specified text inside
Awesome! Thank you.
Could you please explain what's the meaning "GoTo 0" in your code? I cannot find any line labeled with "0". |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
locate shapes with specified text inside
On Error Resume Next
suspends breaking on errors On Error Goto 0 restores breaking on errors These should be used in pairs and encompass an include as few statements as necessary as they can mask real errors making debugging very difficult. -- Regards, Tom Ogilvy "lvcha.gouqizi" wrote in message ups.com... Awesome! Thank you. Could you please explain what's the meaning "GoTo 0" in your code? I cannot find any line labeled with "0". |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
locate shapes with specified text inside
Thanks for explaining.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculate quantity of shapes inside another shape | Excel Discussion (Misc queries) | |||
How do I locate cells that contain a certain text? | Excel Worksheet Functions | |||
How to embed large number of variables in text inside a text box? | Excel Discussion (Misc queries) | |||
Using IF to locate specific text string value | Excel Programming | |||
Text on shapes | Excel Programming |