View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
robbie de sutter robbie de sutter is offline
external usenet poster
 
Posts: 1
Default Column width in pixels how?

Hello,

How can I determine the column width in pixels in VBA (excel 2002 sp2)?

In a new workbook I try to determine the width of column A.
Clicking between 2 columns displays the following information (provided
by excel - the pixel value is in this case correct):
"Width: 8.43 (64 pixels)"

So I need the value 64 in my VBA code, but HOW?

Allready tried to following:

range("A1").width
returns 48 (?!?!?!)
range("A1").Columnwidth
returns 8.43
ActiveWindow.PointsToScreenPixelsX(range("A1").wid th)
returns 146
ActiveWindow.PointsToScreenPixelsX(range("A1").wid th)
returns 106


Also I have exactly the same problem when trying to determine the row
height...

Can anybody help me?
thanks in advance,
Robbie De Sutter