ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   objectos (https://www.excelbanter.com/excel-programming/332553-objectos.html)

Larry Sartoris

objectos
 
Is there a way to write "select autoshape 1 and if there isn't an autoshape 1
select autoshape2"?

Tom Ogilvy

objectos
 
On error resume next
set shp = Activesheet.shapes("autoshape 1")
On error goto 0
if not shp is nothing then
set shp = Activesheet.Shapes("autoshape 2")
End if
shp.select

--
Regards,
Tom Ogilvy

"Larry Sartoris" wrote in message
...
Is there a way to write "select autoshape 1 and if there isn't an

autoshape 1
select autoshape2"?




Bob Phillips[_6_]

objectos
 

Dim shp As Shape
On Error Resume Next
Set shp = ActiveSheet.Shapes("Autoshape1")
If Not shp Is Nothing Then
ActiveSheet.Shapes("Autoshape1").Select
Else
ActiveSheet.Shapes("Autoshape2").Select
End If
On Error GoTo 0


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Larry Sartoris" wrote in message
...
Is there a way to write "select autoshape 1 and if there isn't an

autoshape 1
select autoshape2"?




Vic Eldridge[_3_]

objectos
 
Is there a way to write "select autoshape 1 and if there isn't an autoshape
1
select autoshape2"?


The following one-liner may be all you need.

Activesheet.Shapes(1).Select


Regards,
Vic Eldridge


All times are GMT +1. The time now is 11:35 PM.

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