#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default objectos

Is there a way to write "select autoshape 1 and if there isn't an autoshape 1
select autoshape2"?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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"?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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"?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"