I am using a VBA to auto fit the widest entry for a range of columns. I am wondering if there is a way to add some space to the auto fit so the columns are not so tight to the text. If some one could lay out the format I would appreciate it.
Sub ColumnWidth()
Columns("A:A").AutoFit
Columns("A:A").ColumnWidth = Columns("A:A").ColumnWidth + 2
End Sub
I found this on a youtube video and it seems to work. But I don't really understand the code. Do you see any problem with it? Thanks
Sub AUTOFIT_COLUMN()
Application.ScreenUpdating = False
Cells.EntireColumn.autofit
For i = 1 To ActiveSheet.UsedRange.Columns.Count
Columns(i).ColumnWidth = Columns(i).ColumnWidth + 3
Next i
Application.ScreenUpdating = True
End Sub
Sub DETAIL_FORM2_COPYROW()
Application.ScreenUpdating = False
Sheets("DETAIL FORM2").Activate
Range("A30:X1500").ClearContents
Rows("29:29").Copy
Rows("29:" & Range("B1").Value).Select
Selection.PasteSpecial xlFormulas
Selection.PasteSpecial xlFormats
Range("H:X").Columns.AutoFit
'For i = 1 To ActiveSheet.UsedRange.Columns.Count
'Columns(i).ColumnWidth = Columns(i).ColumnWidth + 3
'Next i