This might be the easiest command you have ever seen in VBA. ;)
Sub columns_adjust()
Columns.Autofit
End Sub
Dim file As String
Dim folderpath As String
Dim filename As String
Dim Count_files As Integer
''''''Data'''''''''''''''''''''
folderpath = "C:\Users\Guest\Desktop\myfolder\*.txt"
'''''''''''''''''''''''''''''''''''''
file = Dir(folderpath)
Count_files = 0
While (file <> "")
If Len(file) > 0 Then
filename = Left(file, Len(file) - 4)
Count_files = Count_files + 1
End If
' your code here
file = Dir
Wend