XL98: How to Control the Placement of Objects in MS Excel 98

Last reviewed: February 2, 1998
Article ID: Q178989
The information in this article applies to:
  • Microsoft Excel 98 Macintosh Edition

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

Objects in worksheets can be attached to the cells below them by using one of the three placement styles that are listed in the following table.

   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 placement style option 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, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and 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 needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/supportnet/refguide/

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

REFERENCES

For more information about object placement in Microsoft Excel 98 Macintosh Edition, click the Office Assistant, type "object placement" (without the quotation marks), click Search, and then click to view "Prevent objects from moving and sizing with cells."

NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If MS Excel Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q120802
   TITLE     : Office: How to Add/Remove a Single Office
               Program or Component


Additional query words: XL98
Version : MACINTOSH:98
Platform : MACINTOSH
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.