• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Search box for shapes

jwplaster

New Member
I need help with a macro for looking up shapes by typing the name of the shape into a search box.


This code will find and select the shape.


Activesheet.Shapes("nameofshape").Select


However, I use hundreds of shapes to represent physical items and need a way to add a text box that I can just type the shape I am looking for and it select it.


Thanks
 
Jwplaster


Firstly, Welcome to the Chandoo.org forums


It's great that you found a solution, but why not post it so others can see your technique used!
 
I done it like this.


Sub ShapeLookUp()


Dim shp As Shape

Dim ShapeName As String


ShapeName = InputBox("Shape you are Looking for")


For Each shp In ActiveSheet.Shapes

If shp.Name = ShapeName Then

shp.Select


End If


Next shp


End Sub
 
Jwplaster

You may also want to have a look at this post:

http://chandoo.org/wp/2010/12/02/the-selection-pane/
 
Back
Top