ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Calculating Row Height & Column Width (https://www.excelbanter.com/excel-discussion-misc-queries/233199-calculating-row-height-column-width.html)

RestlessAde

Calculating Row Height & Column Width
 
Does anyone know formulas in Excel for the following:

- Return the column width (in pixels) of the cell containing the formula.
- Return the row height (in pixels) of the cell containing the formula.

Ideally these would be through standard built-in functions, although if not
possible a VB approach would also be fine.

Thanks!
RA

Shane Devenshire[_2_]

Calculating Row Height & Column Width
 
Hi,

There are no functions or formula built into Excel to do this. You could
write a VBA program, but it probably would require a Window's Dll call.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"RestlessAde" wrote:

Does anyone know formulas in Excel for the following:

- Return the column width (in pixels) of the cell containing the formula.
- Return the row height (in pixels) of the cell containing the formula.

Ideally these would be through standard built-in functions, although if not
possible a VB approach would also be fine.

Thanks!
RA


RestlessAde

Calculating Row Height & Column Width
 
Hi Shane,

Thanks for letting me know it can't be done via formulas. Can you (or anyone
else) suggest the VB code for Excel? I'm not sure what you mean by a Windows
DLL call.

Regards,
RA

"Shane Devenshire" wrote:

Hi,

There are no functions or formula built into Excel to do this. You could
write a VBA program, but it probably would require a Window's Dll call.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"RestlessAde" wrote:

Does anyone know formulas in Excel for the following:

- Return the column width (in pixels) of the cell containing the formula.
- Return the row height (in pixels) of the cell containing the formula.

Ideally these would be through standard built-in functions, although if not
possible a VB approach would also be fine.

Thanks!
RA


Ron Rosenfeld

Calculating Row Height & Column Width
 
On Mon, 8 Jun 2009 09:07:01 -0700, RestlessAde
wrote:

Does anyone know formulas in Excel for the following:

- Return the column width (in pixels) of the cell containing the formula.
- Return the row height (in pixels) of the cell containing the formula.

Ideally these would be through standard built-in functions, although if not
possible a VB approach would also be fine.

Thanks!
RA


In order to do this, you need to know the "dpi" of the display. RowHeight and
ColumnWidth are properties of the Range object. But the result is in points.
--ron

FSt1

Calculating Row Height & Column Width
 
hi
row height is measured in points. 72 point per inch.
column width is measured in characters. 13 characters per inch.(which is
REEEAL iffy)
http://office.microsoft.com/en-us/ex...375451033.aspx

you didn't say why you keeded this so i am just supply general infor based
on some stuff i did some time back when i had to develope a grid to draw maps
of our warehouse and productions floor.
http://office.microsoft.com/en-us/ex...517241033.aspx

i did some conversion for you but you can redo the math to fit your needs.
no is it exact. the best you can hope is "close".

Dim s As Long
s = InputBox("enter the pixels")
Columns("C:C").ColumnWidth = s * 0.1354
Rows("10:10").RowHeight = s * 0.75

'note: the above produces a near perfect square.

MsgBox Columns("C:C").ColumnWidth * 7.5
MsgBox Rows("10:10").RowHeight * 1.33333333334

'should tell you the approximate size of the square in pixels

regards
FSt1


"RestlessAde" wrote:

Does anyone know formulas in Excel for the following:

- Return the column width (in pixels) of the cell containing the formula.
- Return the row height (in pixels) of the cell containing the formula.

Ideally these would be through standard built-in functions, although if not
possible a VB approach would also be fine.

Thanks!
RA



All times are GMT +1. The time now is 04:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com