Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Referencing Shapes

Hi there,

Can anyone tell me how you can name shapes in excel, so that you can then
reference them programatically?

I'd like to include a number of small circles that change from red to green
on a given condition. At the moment I can only do this using the Selection
method, which I want to avoid.

Thanks

John


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Referencing Shapes

John,

You can either do it by selecting the shape on the worksheet and changing
the name in the Names box, or with VBA

activesheet.shapes(1).name="Bob"

--

HTH

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


"John" wrote in message
...
Hi there,

Can anyone tell me how you can name shapes in excel, so that you can then
reference them programatically?

I'd like to include a number of small circles that change from red to

green
on a given condition. At the moment I can only do this using the

Selection
method, which I want to avoid.

Thanks

John




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Referencing Shapes

Bob,

Thanks very much for this. Having tried out your advice I see that the 1 in
brackets indicates the order in which the shapes were placed on the
worksheet? If I ran the code to change the shape names, would the name
changes be saved with the workbook or would I have to reassign each on Open
or something similar?

Thanks again

John
"Bob Phillips" wrote in message
...
John,

You can either do it by selecting the shape on the worksheet and changing
the name in the Names box, or with VBA

activesheet.shapes(1).name="Bob"

--

HTH

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


"John" wrote in message
...
Hi there,

Can anyone tell me how you can name shapes in excel, so that you can then
reference them programatically?

I'd like to include a number of small circles that change from red to

green
on a given condition. At the moment I can only do this using the

Selection
method, which I want to avoid.

Thanks

John






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Referencing Shapes

As long as you saved the workbook after changing the names, the names would
be retained.

--
Regards,
Tom Ogilvy

"John" wrote in message
...
Bob,

Thanks very much for this. Having tried out your advice I see that the 1

in
brackets indicates the order in which the shapes were placed on the
worksheet? If I ran the code to change the shape names, would the name
changes be saved with the workbook or would I have to reassign each on

Open
or something similar?

Thanks again

John
"Bob Phillips" wrote in message
...
John,

You can either do it by selecting the shape on the worksheet and

changing
the name in the Names box, or with VBA

activesheet.shapes(1).name="Bob"

--

HTH

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


"John" wrote in message
...
Hi there,

Can anyone tell me how you can name shapes in excel, so that you can

then
reference them programatically?

I'd like to include a number of small circles that change from red to

green
on a given condition. At the moment I can only do this using the

Selection
method, which I want to avoid.

Thanks

John








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Referencing Shapes

Damn that's quick!

Thanks Tom
"Tom Ogilvy" wrote in message
...
As long as you saved the workbook after changing the names, the names
would
be retained.

--
Regards,
Tom Ogilvy

"John" wrote in message
...
Bob,

Thanks very much for this. Having tried out your advice I see that the 1

in
brackets indicates the order in which the shapes were placed on the
worksheet? If I ran the code to change the shape names, would the name
changes be saved with the workbook or would I have to reassign each on

Open
or something similar?

Thanks again

John
"Bob Phillips" wrote in message
...
John,

You can either do it by selecting the shape on the worksheet and

changing
the name in the Names box, or with VBA

activesheet.shapes(1).name="Bob"

--

HTH

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


"John" wrote in message
...
Hi there,

Can anyone tell me how you can name shapes in excel, so that you can

then
reference them programatically?

I'd like to include a number of small circles that change from red to
green
on a given condition. At the moment I can only do this using the
Selection
method, which I want to avoid.

Thanks

John










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


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel document with shapes on it but the shapes do not print [email protected] Excel Worksheet Functions 2 October 22nd 09 06:17 PM
Naming Auto Shapes and Creating new Shapes AL2000 Excel Discussion (Misc queries) 3 September 10th 07 04:12 AM
When drawing shapes in excel the shapes keep disappearing Tape Excel Discussion (Misc queries) 1 October 6th 06 04:23 PM
How can i get more 3D shapes for Auto shapes in excel? Ajey Excel Discussion (Misc queries) 0 March 3rd 05 09:53 AM
How can i get more 3D shapes for Auto shapes in excel? Ajey Excel Discussion (Misc queries) 0 March 3rd 05 09:53 AM


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

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

About Us

"It's about Microsoft Excel"