Solved

Working with shapes

Posted on 2000-03-19
13
545 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

733 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