ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   deselect one of the shapes (https://www.excelbanter.com/excel-programming/419829-deselect-one-shapes.html)

already

deselect one of the shapes
 
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

Bob Phillips[_3_]

deselect one of the shapes
 
Just select a worksheet cell, say A1


Range("A1").Select

--
__________________________________
HTH

Bob

"already" wrote in message
...
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




already

deselect one of the shapes
 
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


"Bob Phillips" wrote:

Just select a worksheet cell, say A1


Range("A1").Select

--
__________________________________
HTH

Bob

"already" wrote in message
...
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





Dave Peterson

deselect one of the shapes
 
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


already wrote:

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


--

Dave Peterson

already

deselect one of the shapes
 
Hi Dave

That's a nice one. Thanks very much !!!

All

"Dave Peterson" wrote:

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


already wrote:

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


--

Dave Peterson



All times are GMT +1. The time now is 11:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com