Solved

Working with shapes

Posted on 2000-03-19
13
519 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Some time ago I was asked to create a VBA function that would calculate a check digit for an input number, using the following procedure: First, sum up all the individual digits in the number If that sum value has more than one digit, then sum up …
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
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 …

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now