I have some VBA and batch Scripts that read the Mac Address Table out of some switches and import it into Excel to format it.
But the text is too long for the default cell width.
Is it possible to change the displayed cell width?
(When saying displayed cell width I mean: this)
Another method would be:
.Columns("A").ColumnWidth = 20 (or whatever value you need)
I didn't compare it speedwise but why my guess would be that it's more efficient to just use Columns() instead of Range().
For more info on the ColumnWidth-Value -> MSDN Doc for the columnwidth-property
Use this:
Range("A1").ColumnWidth = ...
The units for this value are as following:
One unit of column width is equal to the width of one character in the Normal style. For proportional fonts, the width of the character 0 (zero) is used.
For example, the column width for freshly opened Excel file with default styles is 8.43
which is equal to 64 pixels.
...or this to autofit width:
Range("A1").EntireColumn.AutoFit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With