AutoFit Column Activity Doesn't Work

Hi all,

I am tyrying to use AutoFit Column Activity but my excel is still the same. Where am i doing wrong?

1 Like

Have you tried selecting the full column before the autofit?

1 Like

@balupad14

1 Like

I saw the image. Use the Autofit Column after the excel application scope. Don’t use inside.

Regards
Balamurugan.S

1 Like

i just mentioned you to help the guy xd. Regards dude! appreciate you

1 Like

Use Invoke VBA Activity Inside Excel Application scope. Inside this provide the Text file path & Macro name inside Properties panel. And Paste the below macro code inside Text file.

Sub AutoFitColumns()

Dim sht As Worksheet

'AutoFit Every Worksheet Column in a Workbook
For Each sht In ThisWorkbook.Worksheets
sht.Cells.EntireColumn.AutoFit
Next sht

End Sub

1 Like