Sub ExtractTodayData()
Dim ws As Worksheet
Dim newWb As Workbook
Dim summaryWs As Worksheet
Dim lastRow As Long
Dim summaryRow As Long
Dim cell As Range
Dim todayDate As Date
Dim searchRange As Range
Dim found As Range
Dim firstAddress As String
Dim columnStart As String
Dim columnEnd As String
columnStart = "A"
columnEnd = "O"
todayDate = Date
Set newWb = Workbooks.Add
Set summaryWs = newWb.Sheets(1)
summaryWs.Name = "Today's Summary"
summaryRow = 1
For Each ws In ThisWorkbook.Worksheets
If summaryRow = 1 Then
ws.Range(columnStart & "1:" & columnEnd & "1").Copy Destination:=summaryWs.Range(columnStart & summaryRow)
summaryRow = summaryRow + 1
End If
Next ws
For Each ws In ThisWorkbook.Worksheets
lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
Set searchRange = ws.Range("A2:A" & lastRow)
Set found = searchRange.Find(What:=todayDate, LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
If Not found Is Nothing Then
firstAddress = found.Address
Do
summaryWs.Range(columnStart & summaryRow & ":" & columnEnd & summaryRow).Value = _
ws.Range(columnStart & found.Row & ":" & columnEnd & found.Row).Value
summaryRow = summaryRow + 1
Set found = searchRange.FindNext(found)
Loop While Not found Is Nothing And found.Address <> firstAddress
End If
NextSheet:
Next ws
summaryWs.Columns(columnStart & ":" & columnEnd).AutoFit
MsgBox "Today's data has been extracted to a new workbook.", vbInformation, "Process Completed"
End Sub