+ Reply to Thread
Results 1 to 5 of 5

Seeking Help with Cell/Range Height and Width Properties

  1. #1
    Joseph Geretz
    Guest

    Seeking Help with Cell/Range Height and Width Properties

    I set the Print Area of my worksheet to a single cell. In code, after
    retrieving the Range to an object called PR,

    PR.Height = 12.75
    PR.Width = 48

    This looks about right to me. The default cell looks to be about 4 times
    wider than it is high.

    Now PR.Height definitely correlates to what I see within the Excel UI. If I
    right click on the Row header and select Row Height... I get a dialog box
    which states 12.75.

    However, PR.Width is a little less straightforward. If I right click on the
    Column header and select Column Width... I get a dialog box which states
    8.43. How does 8.43, correlate to a value of 48 which I get programmatically
    through the automation object model?

    And secondly, what are the units of measurement represented by these values?

    Thanks very much for your help!

    - Joseph Geretz -




  2. #2
    Joseph Geretz
    Guest

    Re: Seeking Help with Cell/Range Height and Width Properties

    Points?!!? That's unique!

    I brute forced it. Clipped the screenshot into Corel and fiddled around with
    the units indicator until the numbers matched. 12.75 points high by 48
    points wide.

    But I'm still wondering about why the UI reports a a width of 8.43. I note
    that 48 points = 16.933 millimeters which is almost (but not precisely) 8.43
    * 2. What sort of a unit is roughly half a millimeter?

    Thanks!

    "Joseph Geretz" <[email protected]> wrote in message
    news:[email protected]...
    >I set the Print Area of my worksheet to a single cell. In code, after
    >retrieving the Range to an object called PR,
    >
    > PR.Height = 12.75
    > PR.Width = 48
    >
    > This looks about right to me. The default cell looks to be about 4 times
    > wider than it is high.
    >
    > Now PR.Height definitely correlates to what I see within the Excel UI. If
    > I right click on the Row header and select Row Height... I get a dialog
    > box which states 12.75.
    >
    > However, PR.Width is a little less straightforward. If I right click on
    > the Column header and select Column Width... I get a dialog box which
    > states 8.43. How does 8.43, correlate to a value of 48 which I get
    > programmatically through the automation object model?
    >
    > And secondly, what are the units of measurement represented by these
    > values?
    >
    > Thanks very much for your help!
    >
    > - Joseph Geretz -
    >
    >
    >




  3. #3
    Dick Kusleika
    Guest

    Re: Seeking Help with Cell/Range Height and Width Properties

    Joseph:

    8.43 is the number of zeros that will fit in the cell using the default
    font. Pretty intuitive, huh? See

    http://www.dailydoseofexcel.com/arch...ths-in-points/

    for more information.


    --
    **** Kusleika
    MS MVP - Excel
    www.dailydoseofexcel.com

    Joseph Geretz wrote:
    > I set the Print Area of my worksheet to a single cell. In code, after
    > retrieving the Range to an object called PR,
    >
    > PR.Height = 12.75
    > PR.Width = 48
    >
    > This looks about right to me. The default cell looks to be about 4
    > times wider than it is high.
    >
    > Now PR.Height definitely correlates to what I see within the Excel
    > UI. If I right click on the Row header and select Row Height... I get
    > a dialog box which states 12.75.
    >
    > However, PR.Width is a little less straightforward. If I right click
    > on the Column header and select Column Width... I get a dialog box
    > which states 8.43. How does 8.43, correlate to a value of 48 which I get
    > programmatically through the automation object model?
    >
    > And secondly, what are the units of measurement represented by these
    > values?
    > Thanks very much for your help!
    >
    > - Joseph Geretz -




  4. #4
    Joseph Geretz
    Guest

    Re: Seeking Help with Cell/Range Height and Width Properties

    Thanks ****!

    Great link - I never would have thought of that! Gotta give some developer
    credit ;-)

    I'm getting quite an education on how to acquire a range and then get
    information regarding the physical area of the range. (In points, but from
    points it's easy to gi to inches, twips, pixels, any other unit of
    measurement I need.)

    Is there any way to go the other way around? That is, given a height and
    width, is there any way to start from a cell at the top left (I'm willing to
    use A1 for now) and have Excel hand me back the Range of cells which qualify
    for inclusion in the specified area?

    Thanks for your help!

    - Joe Geretz -

    "**** Kusleika" <[email protected]> wrote in message
    news:%23%[email protected]...
    > Joseph:
    >
    > 8.43 is the number of zeros that will fit in the cell using the default
    > font. Pretty intuitive, huh? See
    >
    > http://www.dailydoseofexcel.com/arch...ths-in-points/
    >
    > for more information.
    >
    >
    > --
    > **** Kusleika
    > MS MVP - Excel
    > www.dailydoseofexcel.com
    >
    > Joseph Geretz wrote:
    >> I set the Print Area of my worksheet to a single cell. In code, after
    >> retrieving the Range to an object called PR,
    >>
    >> PR.Height = 12.75
    >> PR.Width = 48
    >>
    >> This looks about right to me. The default cell looks to be about 4
    >> times wider than it is high.
    >>
    >> Now PR.Height definitely correlates to what I see within the Excel
    >> UI. If I right click on the Row header and select Row Height... I get
    >> a dialog box which states 12.75.
    >>
    >> However, PR.Width is a little less straightforward. If I right click
    >> on the Column header and select Column Width... I get a dialog box
    >> which states 8.43. How does 8.43, correlate to a value of 48 which I get
    >> programmatically through the automation object model?
    >>
    >> And secondly, what are the units of measurement represented by these
    >> values?
    >> Thanks very much for your help!
    >>
    >> - Joseph Geretz -

    >
    >




  5. #5
    Dick Kusleika
    Guest

    Re: Seeking Help with Cell/Range Height and Width Properties

    There's no built in way that I know. You'd have to loop down the column and
    across the rows adding up the row heights and column widths as you go and
    stopping when you hit your number.

    --
    **** Kusleika
    MS MVP - Excel
    www.dailydoseofexcel.com

    Joseph Geretz wrote:
    > Thanks ****!
    >
    > Great link - I never would have thought of that! Gotta give some
    > developer credit ;-)
    >
    > I'm getting quite an education on how to acquire a range and then get
    > information regarding the physical area of the range. (In points, but
    > from points it's easy to gi to inches, twips, pixels, any other unit
    > of measurement I need.)
    >
    > Is there any way to go the other way around? That is, given a height
    > and width, is there any way to start from a cell at the top left (I'm
    > willing to use A1 for now) and have Excel hand me back the Range of
    > cells which qualify for inclusion in the specified area?
    >
    > Thanks for your help!
    >
    > - Joe Geretz -
    >
    > "**** Kusleika" <[email protected]> wrote in message
    > news:%23%[email protected]...
    >> Joseph:
    >>
    >> 8.43 is the number of zeros that will fit in the cell using the
    >> default font. Pretty intuitive, huh? See
    >>
    >> http://www.dailydoseofexcel.com/arch...ths-in-points/
    >>
    >> for more information.
    >>
    >>
    >> --
    >> **** Kusleika
    >> MS MVP - Excel
    >> www.dailydoseofexcel.com
    >>
    >> Joseph Geretz wrote:
    >>> I set the Print Area of my worksheet to a single cell. In code,
    >>> after retrieving the Range to an object called PR,
    >>>
    >>> PR.Height = 12.75
    >>> PR.Width = 48
    >>>
    >>> This looks about right to me. The default cell looks to be about 4
    >>> times wider than it is high.
    >>>
    >>> Now PR.Height definitely correlates to what I see within the Excel
    >>> UI. If I right click on the Row header and select Row Height... I
    >>> get a dialog box which states 12.75.
    >>>
    >>> However, PR.Width is a little less straightforward. If I right click
    >>> on the Column header and select Column Width... I get a dialog box
    >>> which states 8.43. How does 8.43, correlate to a value of 48 which
    >>> I get programmatically through the automation object model?
    >>>
    >>> And secondly, what are the units of measurement represented by these
    >>> values?
    >>> Thanks very much for your help!
    >>>
    >>> - Joseph Geretz -




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1