Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / May 2008

Tip: Looking for answers? Try searching our database.

Formula to display column widths?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rob - 31 May 2008 04:17 GMT
Could someone please suggest a formula which could display the width of a
column in pixels.

I have to produce tables to a specific width, and this would make formatting
them easier - I could avoid clicking on each column individually to check.
Mike H - 31 May 2008 10:46 GMT
Rob,

A small UDF

Function colwidth(rng As Range)
colwidth = rng.ColumnWidth
End Function

Call with =colwidth(A1) or whichever column you want.

If you want to convert to pixels you can have an approximation by
multiplying * 7.5 or if you'd like to do the maths yourself have a look here
for the correct way to convert. If you drag a column you can see the width in
Pixels in paretthesis.

http://groups.google.com/group/microsoft.public.office.developer.com.add_ins/bro
wse_thread/thread/2fc33557feb72ab4/adaddc50480b8cff?lnk=raot


Me, I'd stick with an approximation!!

Mike

> Could someone please suggest a formula which could display the width of a
> column in pixels.
>
> I have to produce tables to a specific width, and this would make formatting
> them easier - I could avoid clicking on each column individually to check.
Gord Dibben - 31 May 2008 16:36 GMT
Row heights are measured in points or pixels.  There are 72 points to an inch
and "maybe" 96 pixels to the inch.

The number that appears in the Standard column width box is the average number
of digits 0-9 of the standard font that fit in a cell.

When dragging the column width you will see two numbers.........one is width as
above, the other is pixels.

For an interesting and enlightening discussion on this subject see

http://snipurl.com/dzz8

If you want to use VBA to set height and width in mm.

Ole Erlandson has code for setting row and column dimensions.

http://www.erlandsendata.no/english/index.php?d=envbawssetrowcol

Gord Dibben Excel MVP

>Could someone please suggest a formula which could display the width of a
>column in pixels.
>
>I have to produce tables to a specific width, and this would make formatting
>them easier - I could avoid clicking on each column individually to check.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.