Macro advice (Multiple Count)

Hi all.

Below is a simple PowerClip macro I’m using to powerclip drop shadows. It works well enough but I would like to add an If condition to Exit Sub if the right number of shapes are not selected.

Because drop shadows read as two objects, and grouping several read as one object, I need an If condition count for 2 ‘or’ 3 objects. The bracketed example below is what I’m using now, but this only works on the container and a single drop shadow (3 objects in total).

I know this must be simple, and I’ve figured out more difficult issues, but I cannot find anywhere that solves this problem. If anyone can point me in the right direction it would be greatly appreciated.

Thanks in advance


Sub PowerClip()

Dim c As Shape, sh As Shape

Set c = ActiveSelection.Shapes.Item(1)
 'Sets the the container, the last object selected

Set sh = ActiveSelection.Shapes.Item(2)
 'Sets the powerclip object, the first object to be selected

sh.AddToPowerClip c

End Sub

(If ActiveSelection.Shapes.Count = 3 Then)