Read what's in the shape

Killersanta

New Member
Joined
Oct 10, 2013
Messages
2
What I basically want is a line of code that can read what's in a shape. So if I click on a shape with a macro assigned to it, that macro reads which text is in the shape so it can look for it in a list and get the other information. So what I need is some code (as short as possible) that reads what's currently in the shape button on which I clicked.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
In the Immediate Window in the Visual basic editor (press Ctrl + G if you don't see an immediate window), insert
Code:
?selection.text
and press enter.

Make sure the shape is selected.

Cheers!
 
Upvote 0
But isn't there a way for the macro to select the shape on which I clicked and then reads what's in it? Because I have a lot of shapes that are auto generated and all have the same macro. I basically need to make a system for a diner to take orders and such for school but if you have to select something first it's not really user friendly or professional because when you select a shape you see options to turn it, or make it bigger etc.
 
Upvote 0
If the shape is selected you can use "Selection.Text". Depending on what you want you get

MsgBox Selection.Text, or
Debug.Print Selection.Text

or something else.

Good luck!
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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