Solved

Working with shapes

Posted on 2000-03-19
13
557 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

626 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