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

Friday, January 05, 2024

Excel: Adding Table as a Data validation using INDIRECT function

  1. Create a table and name it. Say TableDiv and the items should be of the column name Division
  2. In the data validation source, select the INDIRECT function and add the following validation =indirect("TableDiv[Division]")