See if the following modification works for you.....
The below code will prompt you to input a date in Input Box and then check the column A in Sheet1 of all the destination workbooks and if found, it copies the row to the Master workbook.
Sub Import_to_Master()
Dim sFolder As String
Dim sFile As String
Dim wbD As Workbook, wbS As Workbook
Dim wsD As Worksheet
Dim myDate As Variant, r As Long
Application.ScreenUpdating = False
Set wbS = ThisWorkbook
sFolder = wbS.Path & "\"
sFile = Dir(sFolder)
Do Until IsDate(myDate) = True
myDate = InputBox("Enter A Date (DD/MM/YYYY).")
If Not IsDate(myDate) Then
MsgBox "You have entered an invalid Date. Please try again.....", vbExclamation, "Invalid Date"
End If
Loop
myDate = CDbl(CDate(myDate))
Do While sFile <> ""
If sFile <> wbS.Name Then
Set wbD = Workbooks.Open(sFolder & sFile) 'open the file; add condition to
Set wsD = wbD.Sheets("Sheet1")
If WorksheetFunction.CountIf(wsD.Columns(1), myDate) > 0 Then
' >>>>>> Adapt this part
r = Application.Match(myDate, wsD.Range("A:A"), 0)
wsD.Range("A" & r & ":H" & r).Copy
wbS.Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Application.CutCopyMode = False
' >>>>>>
End If
wbD.Close savechanges:=True 'close without saving
End If
sFile = Dir 'next file
Loop
Application.ScreenUpdating = True
End Sub
Bookmarks