text in a shape

Jackeb

Board Regular
Joined
Mar 20, 2002
Messages
81
Can anyone help me..??

What is the line of code to retrieve the text in an autoshape?

how do i test this text for a certain word, the word is current..??

Heelllppppp......

cheers

Ed
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
The following code tests the selected autoshape:

TestText = Selection.Characters.Text
If TestText = "current" Then MsgBox "Text is equal to current"
 
Upvote 0
yeah,

I have selected the shape using:

Sub currentbar()
Dim sh As Shape, shtxt As String


For Each sh In ActiveSheet.Shapes

sh.Select
shtxt = Selection.Characters.Text

Debug.Print shtxt

Next

Set sh = Nothing
End Sub

but I cannot get a list of the text in the autoshapes....

I am sure that it is a simple solution!?!?!?!
 
Upvote 0
Try the following:

For Each sh In ActiveSheet.Shapes

sh.Select
On Error Resume Next
shtxt = Selection.Characters.Text

MsgBox shtxt

Next
 
Upvote 0
that is great,

It didn't like the shapes without any text in, that bypassed it...


Merci
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,585
Members
448,972
Latest member
Shantanu2024

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top