Dim wb As Workbook
Dim FSO As Object
Dim fld As Object
Dim fl As Object
Dim strPath As String
strPath = "C:\test\" ' change path as required
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fld = FSO.GetFolder(strPath)
Application.EnableEvents = False
Application.ScreenUpdating = False
For Each fl In fld.Files
If Right(fl, 4) = ".xlsm" Then
Set wb = Workbooks.Open(fl.Path)
wb.Sheets(1).Range("AD:AD").EntireColumn.Insert xlShiftToRight
wb.Sheets(1).Range("A1").Value = "Eurostd"
wb.Close SaveChanges:=True
End If
Next fl
Application.EnableEvents = True
Application.ScreenUpdating = False
Sub InsertEurostdCol()
Dim wb As Workbook
Dim FSO As Object
Dim fld As Object
Dim fl As Object
Dim strPath As String
strPath = "C:\test\" ' change path as required
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fld = FSO.GetFolder(strPath)
Application.EnableEvents = False
Application.ScreenUpdating = False
For Each fl In fld.Files
If Right(fl, 4) = ".xlsm" Then
Set wb = Workbooks.Open(fl.Path)
wb.Sheets(1).Range("AD:AD").EntireColumn.Insert xlShiftToRight
wb.Sheets(1).Range("A1").Value = "Eurostd"
wb.Close SaveChanges:=True
End If
Next fl
Application.EnableEvents = True
Application.ScreenUpdating = False
End Sub
Sub InsertEurostdCol()
Dim wb As Workbook
Dim FSO As Object
Dim fld As Object
Dim fl As Object
Dim strPath As String
strPath = "C:\test\" ' change path as required
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fld = FSO.GetFolder(strPath)
Application.EnableEvents = False
Application.ScreenUpdating = False
For Each fl In fld.Files
If Right(fl.Name, 4) = ".xlsm" Then
Set wb = Workbooks.Open(fl.Path)
wb.Sheets(1).Range("AD:AD").EntireColumn.Insert xlShiftToRight
wb.Sheets(1).Range("A1").Value = "Eurostd"
wb.Close SaveChanges:=True
End If
Next fl
Application.EnableEvents = True
Application.ScreenUpdating = False
End Sub