Uploaded December 2025 | Updated September 2026, 2 weeks ago
Welcome to dptutorials, the place where Excel becomes smarter, cleaner, and fully automated with simple tricks that save your time. In this short tutorial, you will learn how to automatically adjust Excel column widths using a very small VBA script. Instead of dragging column boundaries or clicking AutoFit every time your data changes, this automation makes Excel handle it for you instantly.
By using the Worksheet_Change event, Excel watches for any cell update and immediately applies AutoFit to the entire sheet. The VBA code is extremely simple:
Private Sub Worksheet_Change(ByVal Target As Range)
Cells.EntireColumn.AutoFit
End Sub
Once you paste this code into the sheet module, your column widths will automatically resize whenever you type, paste, or update data. This is extremely useful for data entry sheets, CRM exports, daily logs, trackers, MIS reports, and files where text length keeps changing.
This automation gives your Excel sheet a professional, clean look without any manual effort. If you enjoy learning smart Excel automation using formulas, VBA, and shortcuts, subscribe to dptutorials for more practical, real-world Excel tutorials that improve your workflow instantly.
#ExcelShorts #ExcelTips #ExcelVBA
Welcome to dptutorials, the place where Excel becomes smarter, cleaner, and fully automated with simple tricks that save your time. In this short tutorial, you will learn how to automatically adjust Excel column widths using a very small VBA script. Instead of dragging column boundaries or clicking AutoFit every time your data changes, this automation makes Excel handle it for you instantly.
By using the Worksheet_Change event, Excel watches for any cell update and immediately applies AutoFit to the entire sheet. The VBA code is extremely simple:
Private Sub Worksheet_Change(ByVal Target As Range)
Cells.EntireColumn.AutoFit
End Sub
Once you paste this code into the sheet module, your column widths will automatically resize whenever you type, paste, or update data. This is extremely useful for data entry sheets, CRM exports, daily logs, trackers, MIS reports, and files where text length keeps changing.
This automation gives your Excel sheet a professional, clean look without any manual effort. If you enjoy learning smart Excel automation using formulas, VBA, and shortcuts, subscribe to dptutorials for more practical, real-world Excel tutorials that improve your workflow instantly.
#ExcelShorts #ExcelTips #ExcelVBA










