What you need to do is form a "Group" of each set of shapes.
First to give each shape a unique number alter the basic code for each of the rectangles in each group as below.
Notice the "1" after "Application caller" , this is the first number of the set and in my code will appear in "A1"
Sub Rectangle1_Click()
Call shps(Application.Caller, 1)
End Sub
Alter the code as above, Change the numbers as required.
When you have done that alter the lines in the "Module " code a shown in Red.
Sub shps(Nam, n)
Dim Shp As Shape
Range("A1") = n
For Each Shp In ActiveSheet.Shapes("Group 15").GroupItems
If Shp.Name = Nam Then
To form a Group of shapes, hold down the "Ctrl" key and select each Shape in the Group.
On the last shape after selecting, Right Click and select "Grouping", "Group" .
The shapes shoud be part of a Group. Look to the formula Box for its name.
In the Module code change the Group 15" to the new shape name.
Try the code out.
Be careful when forming a Group, I found that Shapes close to the group but not wanted in the group somehow got seleted. so keep those temporarily away from the group.
Regards Mick
Bookmarks