A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Discussion (Misc queries)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Calculating Row Height & Column Width



 
 
Thread Tools Display Modes
  #1  
Old June 8th 09, 05:07 PM posted to microsoft.public.excel.misc
RestlessAde
external usenet poster
 
Posts: 7
Default 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
Ads
  #2  
Old June 8th 09, 05:15 PM posted to microsoft.public.excel.misc
Shane Devenshire[_2_]
external usenet poster
 
Posts: 3,346
Default 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

  #3  
Old June 8th 09, 05:45 PM posted to microsoft.public.excel.misc
RestlessAde
external usenet poster
 
Posts: 7
Default 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

  #4  
Old June 8th 09, 05:54 PM posted to microsoft.public.excel.misc
Ron Rosenfeld
external usenet poster
 
Posts: 5,651
Default 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
  #5  
Old June 8th 09, 06:43 PM posted to microsoft.public.excel.misc
FSt1
external usenet poster
 
Posts: 3,942
Default 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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Row height/column width Connie Martin Excel Discussion (Misc queries) 3 June 20th 09 04:12 PM
Column Width and Row Height Workbook Excel Worksheet Functions 4 March 30th 09 06:46 AM
Changing Row Height/Column Width DJ Excel Discussion (Misc queries) 4 February 27th 09 02:07 AM
optimising column width & row height KRK New Users to Excel 2 March 12th 08 12:35 PM
Column Width and Row Height Pillow Excel Worksheet Functions 0 December 13th 05 03:58 PM


All times are GMT +1. The time now is 09:10 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2004-2014 ExcelBanter.
The comments are property of their posters.