Try this:
Option Explicit
Sub IFS()
Dim CopyRNG As Range, Col As Long, c As Range
With Sheets("IRS")
On Error Resume Next
Col = WorksheetFunction.Match("Trade Number", .Rows(1), 0)
If Col = 0 Then
MsgBox "The 'Trade Number' column was not found"
Exit Sub
End If
For Each c In .Range(.Cells(2, Col), .Cells(.Rows.Count, Col)).SpecialCells(xlConstants, 1)
If CDate(c.Value) = CDate(Date) And Rows(c.Row).Hidden = False Then
If CopyRNG Is Nothing Then
Set CopyRNG = .Range("A" & c.Row)
Else
Set CopyRNG = Union(CopyRNG, .Range("A" & c.Row))
End If
End If
Next c
If Not CopyRNG Is Nothing Then CopyRNG.Copy Sheets("Extract").Range("D" & Rows.Count).End(xlUp).Offset(1)
End With
End Sub
Bookmarks