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

  • Thread starter Thread starter J
  • Start date Start date
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top