PointsToCentimeters VBA

Posted on 2011-04-27
Last Modified: 2012-05-11
Dear Experts:

I would like to retrieve the width and height of the first chart in a MsgBox ...
    W = ActiveSheet.ChartObjects(1).Width
    H = ActiveSheet.ChartObjects(1).Height

The measurements are regrettably displayed in Points, but I would like to show the measurements in centimeters rounded to two decimal places after the decimal point.
How is this achieved?

Help is much appreciated, thank you very much in advance,

Regards, Andreas
Question by:AndreasHermle
    LVL 85

    Accepted Solution

    application.round(ActiveSheet.ChartObjects(1).Width / application.CentimetersToPoints(1), 2)

    Open in new window

    and similarly for height.

    Author Closing Comment

    Great. This did the trick. Thank you very much for your professional support. Regards, Andreas

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
    Introduction This Article is a follow-up to my Mappit! Addin Article (, it was inspired by an email posting I made to EUSPRIG (, I will briefly cover: 1) An overvie…
    This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
    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…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now