Is it possible to measure/display the column width with a cell function?

J

J

Wednesday afternoon

Is it possible to measure/display the column width with a cell function?

I need to adjust some columns for a report.

But I cannot find a way to display the current width in units that I can then place in a VBA macro.

Would be very good to have the macro read the values entered in a set of columns and change the width accordingly.


(This is very easy in Quattro pro.)

J
 
B

Bernd Plumhoff

Hello again,

I think MS does *not* make it difficult :)
Another approach:
Option Explicit

Const lbutiwant20 = 20

Sub getnsetwidth()
With Worksheets("Sheet1").Columns("A")
Call MsgBox("Width of column A: " & .ColumnWidth)
.ColumnWidth = lbutiwant20
End With
End Sub

HTH,
Bernd
 
Top