Monday, January 08, 2024

#HowTo Autofit columns in excel

 Problem: Adjusting the width for every column using ALTH+H+O+I is painful 

Solution: Use AutoFit
#How To Steps:
1. Right-click the sheet and select View Code
  1.  


2. Add the following Code under the Worksheet
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Cells.EntireColumn.AutoFit
End Sub

No comments: