Solved

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

Posted on 2008-10-07
3
1,496 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

752 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