Fooling around with "Shapes" and "Selection of shapes"

keldsor

Board Regular
Joined
Jun 9, 2017
Messages
52
I'm just manually trying to move some shapes around on the active worksheet by selecting the shapes AND then with a Sub move them.

IF I in the immidiate window asks for:

? Excel.Selection.Count

I get the correct number back ... tried many different selections

BUT

? Excel.Selection.Item(1).Name

does NOT give me the right name of the first object in the selection ... in fact the shape with that name is not even IN the selection at all !

It looks like it returns the name of the SHAPES instead !

How can I get the names of the shapes in the SELECTION ?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hello,

try it like this (untested)

Code:
sub read_ShapeNames
dim Shp as shape
for each shp in activesheet.shapes
   debug.print shp.name 'also typename(shp) and others
next shp
end sub

regards
 
Upvote 0

Forum statistics

Threads
1,223,630
Messages
6,173,454
Members
452,514
Latest member
cjkelly15

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