Set columns in Excel to Auto Fit

Set columns in Excel to Auto Fit

You are now following this Submission

This function will set the selected columns to autofit.
This is the same as using the Excel menu: Format -> Column -> AutoFit Selection .
Example :xlsAutoFitCol('filename','Sheet1','A:F')

Cite As

Tal Shir (2026). Set columns in Excel to Auto Fit (https://www.mathworks.com/matlabcentral/fileexchange/23270-set-columns-in-excel-to-auto-fit), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0