Automatically translated.View original post

How about this automation?

Is it convenient if this becomes automatic?

@あっこ|ワーママのExcel•PC仕事術👈 other Excel work techniques here

This time, we will introduce how to automatically adjust column width!

Every time you enter a character

Adjusting column widths one by one

It's simply troublesome...🥲

Actually, if you set up a certain setting

The column width will be adjusted automatically just by entering it ✨

How to 👇

① Right-click on the sheet name and open "Display Code"

② Select the worksheet

③ Enter the code below on the second line

Cells. EntireColumn. AutoFit

Just this

When you enter a character, the column width is adjusted automatically 🙌

💡 By the way

When you're too lazy to set up

✔ range

Alt → H → O → I

or

✔ double-click the column name boundary

But you can adjust column width automatically ✨

Please choose an easy-to-use method according to the application 😊

─ ─ ─ ─ ─ ─ ─

Akko | Wormama's Excel Work Techniques

\ "I'm not good at it" to "I can do it a little" /

Make that work easier!

* 1 minute a day and efficiency UP 🔰✨

* Go home 30 minutes early for family time ✨

Look from here 👇

≫ ≫ ≫@あっこ|ワーママのExcel•PC仕事術

─ ─ ─ ─ ─ ─ ─

# excel # excel _ beginner # column width # work efficiency # wahmama

7/25 Edited to

... Read more「エクセル 幅 自動」で探している方って、だいたい“表の見た目がガタガタになる問題”に困ってますよね。私も氏名・部署・メールアドレスみたいに文字数がバラバラな列(OCRにもあったやつ…)を入力していくと、毎回列幅を広げたり戻したりで作業が止まっていました。 まず結論として、列幅の自動調整(AutoFit)は3パターンで使い分けるのがラクでした。 1) その場で一回だけ整える(いちばん安全) ・範囲(または列全体)を選択 → Alt → H → O → I ・または列名(AとBの間など)の境目をダブルクリック 「今日はとりあえず整えばOK」ならこれが最速です。共有ファイルでも影響が少なくて安心。 2) 入力のたびに自動で整える(時短だけど注意あり) 記事の方法(VBEでWorksheetのイベントに AutoFit を入れる)を使うと、入力するだけで列幅が追従します。便利なんですが、私は最初“全部の列が毎回動く”のが気になりました。 おすすめは、必要な列だけに絞ること。例えばB~D列だけなら、こんなイメージです。 ・Columns("B:D").EntireColumn.AutoFit これだと、氏名・部署・メールアドレスみたいに変動しやすい列だけ自動で整います。 3) ピボットテーブルで列幅が戻る問題への対策 検索で「ピボットテーブル」も一緒に出てくるのは、更新のたびに列幅が勝手に変わったり戻ったりする人が多いからだと思います。私がよくやるのは、ピボットテーブル上で 「ピボットテーブル オプション」→「レイアウトと書式」→ “更新時に列幅を自動調整する”のチェックを用途で切り替えること。 ・列幅を固定したい:チェックを外す ・データ増減に合わせたい:チェックを入れる おまけ:excel 関数の結果が「####」になるとき 列幅が足りないサインなので、まずはAutoFit。それでも見づらいときは、日付や数値の表示形式(桁数)を軽くするだけでスッキリします。 私は「普段はショートカットで一発、頻繁に入力する表だけVBAで自動化、ピボットはオプションで固定/自動を切替」の組み合わせに落ち着きました。用途別に使い分けると、見た目も作業スピードもかなり変わります。