Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Excelでは、右側の「境界線」の列をダブルクリックすると、その列の最大値の幅になるように幅のサイズを自動変更できます。
これをVBAでどのように複製しますか?
マクロレコーダを使用して、アクションを実行し、確認することができます。
<range>.entirecolumn.autofit
AutoFitオブジェクトのメソッドを呼び出しColumnます。
AutoFit
Column
そのようです:
ActiveSheet.UsedRange.Columns.AutoFit
またはそう:
Columns("A:A").EntireColumn.AutoFit