Solved

Working with shapes

Posted on 2000-03-19
13
540 Views
Last Modified: 2012-06-27


Using a VBA I have placed a rectangle on the worksheet and then placed a number of textboxes on top of the rectangle.

Is there a way when the user selects a shape, that by holding the left mouse button down and dragging the shape the associated textboxes will move with the shape to the new location.

/Bob
0
Comment
Question by:BobR
  • 7
  • 2
  • 2
  • +1
13 Comments
 
LVL 13

Expert Comment

by:cri
ID: 2633993
Group them
0
 
LVL 13

Expert Comment

by:cri
ID: 2634007
Here the macro (record):
..
..
   ActiveSheet.Shapes.Range(Array("Rectangle 1", "Text Box 2", "Text Box 3")). _
        Select
    Selection.ShapeRange.Group.Select
..
..
 
0
 
LVL 13

Expert Comment

by:cri
ID: 2634011
BTW: Make sure you use connectors if you have lines between the shapes as in a flow/process diagram. Contrary to Word 97, the shapes have this property in Excel and Powerpoint 97
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 13

Expert Comment

by:cri
ID: 2641969
And ?
0
 

Expert Comment

by:joanneL2
ID: 2643305
Yes.  Make sure your DRAWING toolbar is still turned on (it probably is since you're using shapes) and use the arrow on the drawing toolbar to select your textboxes.  You can use the shift key to select more than one text box and then go back to the drawing toolbar, click on DRAW, align and distribute and you can align them the way you like.  You can also right-click on the boxes and group them (which makes it easier to move them together).    You can also use the right mouse button to get into properties where there's lots of ways to finesse your text boxes.  Of course, you can also turn off the lined border with the line tool, change colors or borders, thickness, etc. Hope this helps.
0
 
LVL 13

Expert Comment

by:cri
ID: 2643433
joanneL2, as you are new here: We do not post as answer unless we are sure it is what the asking person wants/needs. By posting as answer you withdraw it from the attention of other experts. Therefore the unwriten rule is that questions that are not simple "how-to" are answered upon invitation.

And: We do not rehash previous comments:

My comment was to group them and I gave the instruction how to do this in VBA. So please demote your posting to a comment.  
0
 
LVL 17

Expert Comment

by:calacuccia
ID: 2644925
Supporting Cri........

I mean, that is no way of handling things, joannetL2. Imagine you had seen a question, provided three useful, correct, and probably perfect comments, and then someone else jumps in, and repeats part of what you have said, and posts as an answer.

Basically, that's all there is as a problem here, your comment is greatly appreciated, but please stay away from the answer button in the future unless really defendable or unevitable.

Cheers

Calacuccia
0
 

Expert Comment

by:joanneL2
ID: 2645614
You're absolutely right.  I AM new here and because I am, I did not know that clicking on "answer" meant that it locked the question.  I thought it was a simple choice of whether your response was more of an answer or more of a comment.  Forgive me.
0
 
LVL 17

Expert Comment

by:calacuccia
ID: 2645630
No Problem, JoanneL2, We knew you are new, and that's why we gently show you the way.

Besides, I was so rude not welcoming you. So,...Welcome Joanne

Calacuccia
0
 

Author Comment

by:BobR
ID: 2654696

The macro:
ActiveSheet.Shapes.Range(Array("Rectangle 1", "Text Box 2", "Text Box 3")). _
        Select
    Selection.ShapeRange.Group.Select

this does not appear to work.
I am attempting to place 1 rectangle and 2 textboxes onto the Worksheet based on the users input on another spreadsheet, and so I do not know what the names of the shapes are as they appear to be dynamic.
What I would like to do is group them together when the user selects the rectangle.

I hope this clears things.

And welcome Joanne and thanks for your comments so far.

/Bob
0
 
LVL 13

Accepted Solution

by:
cri earned 100 total points
ID: 2655084
Worse than dynamically:
http://support.microsoft.com/support/kb/articles/Q160/5/77.asp

Name the shapes right after you create them. Excerpt from:
http://msdn.microsoft.com/library/officedev/office97/web/010.htm#CH010H105

..
..
Each shape is assigned a default name (for example, "Rectangle 3") when you add it to the Shapes collection. To give the shape a more useful, meaningful name, use the Name property. The following example adds a rectangle to myDocument and gives the rectangle the name "Red Square."
myDocument.Shapes.AddShape(msoShapeRectangle,144, 144, 72, 72).Name = "Red Square"
..
..
0
 

Author Comment

by:BobR
ID: 2656291
Thanks the reference you sent me too answered all my questions.
/Bob
0
 
LVL 13

Expert Comment

by:cri
ID: 2657307
You are welcome.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had the experience that you had to follow 10 steps over and over again every time when you need to nicely forward an important email to your manager? Fear no more! With the help of the Quick Steps feature in Outlook 2010, your old chor…
My experience with Windows 10 over a one year period and suggestions for smooth operation
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question