deselect one of the shapes

A

already

Hello

After selecting all my (random) shapes on a sheet with the command

ActiveSheet.Shapes.SelectAll

I want to deselect one of them. I thought that the following code could do
the work but I turn in an error (object doesn't support the method)

ActiveSheet.Shapes("Picture 1").Deselect

What's the way to work around this

Thanks in advance for your help

Kind regards

Al
 
A

already

Hi Bob

Thanks for the reply but this didn't work.

Note that all the shapes are selected and that I only want to remove the
selection of 1 of them

Kind regards

Al
 
D

Dave Peterson

I would just loop through the shapes:

Option Explicit
Sub testme()
Dim Shp As Shape
Dim InitialShape As Boolean

InitialShape = True
For Each Shp In ActiveSheet.Shapes
If Shp.Name = "Button 3" Then
'skip it
Else
Shp.Select Replace:=InitialShape
InitialShape = False
End If
Next Shp
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top