I have tried to write code to open all files in C:\Fixed assets that contain fixed assets for eg BR1 Fixed assets.xlsm, Souther Fixed Assets.xlsm etc
I would like this amended so that it excludes workbooks containing "Consolidated" and "Email"
Application.ScreenUpdating = True
End Sub
Code:
Sub Open_files()
ChDir "C:\Fixed Assets"
Dim A As Variant
Dim LR As Long
If TypeName(A) = "Boolean" Then Exit Sub
Dim FileAry As Variant, Fle As Variant
With Application.FileDialog(3)
.InitialFileName = "C:\Fixed Assets\"
.AllowMultiSelect = True
.InitialFileName = "*Fixed*Assets*.xls*"
If .Show Then Set FileAry = .SelectedItems()
End With
For Each File In FileAry
If TypeName(A) = "Boolean" Then Exit Sub
With Workbooks.Open(File)
End With
I would like this amended so that it excludes workbooks containing "Consolidated" and "Email"
Application.ScreenUpdating = True
End Sub