Microsoft KB Archive/178989

= How to Control the Placement of Objects =

Article ID: 178989

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q178989





SUMMARY
In Microsoft Excel 98 Macintosh Edition, you can control how charts, drawing objects, AutoShapes, and other objects in a worksheet are placed (attached to the cells below them). This article explains how to set the Placement property for objects in worksheets.



MORE INFORMATION
You can attach objects in worksheets to the cells below them using three different placement styles:   Placement style                           xlConstant ---

Move and size with cells        xlMoveAndSize Move but don't size with cells  xlMove Don't move or size with cells   xlFreeFloating You can control how objects are attached to cells by using the Format dialog box or by using Visual Basic for Application code.

Using the Format Dialog Box to Control Placement
To format the placement style for an object, follow these steps:
 * 1) Click to select the object.
 * 2) On the Format menu, click the first item. The name of the item indicates the type of object that is selected, for example, AutoShape, Selected Chart Area, and so on.
 * 3) Click the Properties tab.
 * 4) Under Object Positioning, click the option for the placement style that you want to use.
 * 5) Click OK.

Using Visual Basic Code to Control Placement
You can use the Placement property in Visual Basic for Applications to control the placement style of an object.

Examples:

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. The following examples set the placement style for a form, a chart, or an object: 'A button or other Forms object. ActiveSheet.Shapes("Button 1").Placement = xlMoveAndSize 'An embedded chart. ActiveSheet.ChartObjects("Chart 4").Placement = xlMove 'A drawing object or AutoShape. ActiveSheet.Shapes("Rectangle 3").Placement = xlFreeFloating

