Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

expand column width to the size of the largest value in that column?

Tags:

excel

vba

In Excel if you double-click a column on its right "border" you can auto-size the width to be the width of the largest value in that column.

How does one replicate this in VBA?

like image 658
mezamorphic Avatar asked Jan 16 '23 04:01

mezamorphic


1 Answers

You can use the Macro Recorder to perform the action & see;

<range>.entirecolumn.autofit
like image 147
Alex K. Avatar answered Jan 30 '23 22:01

Alex K.