Dim WkbM As Workbook
Set WkbM = ThisWorkbook
Dim MyObj As Object
Dim MySource As Object
Dim file As Variant
Dim wb As Workbook
Set MyObj = New FileSystemObject
Dim myFile As String
Dim PickFolder As FileDialog
'Retrieve Target Folder Path From User
Set PickFolder = Application.FileDialog(msoFileDialogFolderPicker)
With PickFolder
.Title = "Select A Target Folder"
.AllowMultiSelect = False
If .Show <> -1 Then GoTo NextCode
myPath = .SelectedItems(1)
End With
'In Case of Cancel
NextCode:
myPath = myPath
If myPath = "" Then GoTo ResetSettings
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Dim NUMB As String
'START Loop through all files in selected folder regardless of file type (cvs or excel formats)
Set MySource = MyObj.GetFolder(myPath)
For Each file In MySource.Files
Set wb = Workbooks.Open(Filename:=MySource & "\" & file.Name)
Dim FN As String
FN = file.Name
NUMB = Sheets(1).Cells(1, 1).Value 'picks up the number value in cell A1
If NUMB = "0.11" Or NUMB = "0.12" Or NUMB = "0.13" Then 'I'm not certain if the source cell's formatting will through this off... if the number is actually 0.1101 but only is displaying 2 decimals for example?
WkbM.Sheets(1).Cells(1, 1).Value = NUMB 'I'm not clear here if you want to combine the numbers into a single cell, or paste them down a list
Else
End If
wb.Close SaveChanges:=False 'closes the file w/o saving
Next file
ResetSettings:
'Reset Macro Optimization Settings
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True