Solved

Excel VBA - move a shape within a cell to the bottom right position of the cell

Posted on 2008-10-07
3
1,558 Views
Last Modified: 2012-06-21
If I have a Shape object (e.g. looping through For Each s In Application.ActiveSheet.Shapes) which is located entirely within a single cell.

How can I determine where to move the shape so it is in the bottom right of that cell?
0
Comment
Question by:jnash67
[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
  • 2
3 Comments
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 22661364
Shape.Top = Shape.TopLeftCell.Top + Shape.TopLeftCell.Height - Shape.Parent.Height
   Shape.Left = Shape.TopLeftCell.Left + Shape.TopLeftCell.Width - Shape.Parent.Width

Kevin
0
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 22661408
Correction:

    Shape.Top = Shape.TopLeftCell.Top + Shape.TopLeftCell.Height - Shape.Height
    Shape.Left = Shape.TopLeftCell.Left + Shape.TopLeftCell.Width - Shape.Width

Kevin
0
 

Author Closing Comment

by:jnash67
ID: 31503921
This was perfect. Thx.
0

Featured Post

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!

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
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…

622 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