XL: Macro to Create a Bubble ChartLast reviewed: February 2, 1998Article ID: Q107729 |
The information in this article applies to:
SUMMARYIn Microsoft Excel, you can write a macro to create a bubble chart. Bubble charts are similar to xy (scatter) charts; however, instead of having uniform markers where the pair of x and y values intersect, these points are marked with circles that indicate the relative magnitude of the values in a third series.
MORE INFORMATIONIf you are using Microsoft Excel 97 or Microsoft Excel 98 Macintosh Edition, you do not need to use a macro to create a bubble chart. These versions of Microsoft Excel include built-in support for bubble charts. If you are using Microsoft Excel 5.0 or 7.0, please see the following article in the Microsoft Knowledge Base for a Visual Basic macro to create a bubble chart:
ARTICLE-ID: Q139662 TITLE : XL: How to Use a Visual Basic Macro to Create a Bubble ChartMicrosoft 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/ Creating the MacroTo create the macro, follow these steps:
Explanation of Macro Code
A1: Name of the macro. A2: Disables screen updating. A3: Displays a message. A4: Returns the name of the active document. A5: Presents dialog box of all open documents. A6: Returns the name of the active document A7: Activates the document whose name is in cell A3. A8: Reselects the current selection. A9: Displays a message. A10: Sets up a FOR loop to iterate through the selection. A11: Calculates the width & height of circle for this point. A12: Activates the macro sheet. A13: Selects the circle that is on the macro sheet. A14: Displays the results of formulas. A15: Resizes the circle to the correct dimensions. A16: Copies the circle. A17: Restores the formulas to the cells. A18: Activates the chart. A19: Selects a point on the chart. A20: Pastes the circle on the point. A21: Activates the document whose name is in cell A3. A22: Activates the next cell in the selection. A23: Returns to the beginning of the loop. A24: Activates the chart. A25: Displays a message. A26: Deselects the final point in the chart. A27: Resets the status bar. A28: Ends the macro.
Using the MacroTo use the macro, follow these steps:
=D2/MAX($D$2:$D$5)
REFERENCES"User's Guide 1," version 4.0, Chapter 14 "User's Guide 2," version 4.0, Chapter 7 "User's Guide," version 3.0, Chapters 13 and 19
|
Additional query words: 4.00a 4.00 3.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |