Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » SHAPES/OBJECTS NUMBERING
SHAPES/OBJECTS NUMBERING
Resolved · Low Priority · Version 2003
SHAPES/OBJECTS NUMBERING
I have a spreadsheet that uses Auto Shapes to produce a project milestone chart. The position of the object is determeined by a date in a cell. At the moment, I update the chart by deleting all the shapes and running the macro again to redraw the auto shapes. Every time the auto shapes are drawn, they get a new number. This is not a major issue but the delete shape macro does use the shape identity number to delete it. As I do not know what the number is I use a broad for next loop with an error trap to delete the shapes. Is it possible to reset the numbering so that the next set of auto shape identities start at 1 or is it possible to set the name of the shape so that I can either delete or move only the ones that need to move.Tony
For upcoming training course dates see: Pricing & availability
RE: SHAPES/OBJECTS NUMBERING
Hi TonyThanks for your question
This is pretty straightforward. The following line of code sets the name property of the first shape in the sheet.
Dim shp As Shape
Set shp = ActiveSheet.Shapes(1)
shp.Name = "Test"
MsgBox shp.Name
Hope this helps
Regards
Stephen
|
|
» Forum post: Further training |



Course updates

