Hi, I found this macro on a post and modified it to my needs. It works on one worksheet but not another. The verbage is the same except the names of the worksheets and destination worksheets. It appears that for some reason the "find" function just isn't working on this one but it DOES work on another worksheet in the same workbook. Any ideas? Thanks for any help!
Sub INCIDENTS_CopySignificant()
'Copy cells of cols A,C from rows containing TODAY() in
'col B of the active worksheet (source sheet) to cols
'A,B,C of INCIDENTS_LEAVE_SNAPSHOT (destination sheet)
Sheets("INCIDENTS_LEAVE").Select
Range("A1").Select
Dim DestSheet As Worksheet
Set DestSheet = Worksheets("INCIDENTS_LEAVE_SNAPSHOT")
Dim sRow As Long 'row index on source worksheet
Dim dRow As Long 'row index on destination worksheet
Dim sCount As Long
sCount = 0
dRow = 1
For sRow = 1 To Range("D655").End(xlUp).Row
'use pattern matching to find TODAY'S DATE anywhere in cell
If Cells(sRow, "B") = Date Then
sCount = sCount + 1
dRow = dRow + 1
'copy cols A,C
Cells(sRow - 1, "A").Copy Destination:=DestSheet.Cells(dRow, "A")
Cells(sRow, "A").Copy Destination:=DestSheet.Cells(dRow, "b")
Cells(sRow, "C").Copy Destination:=DestSheet.Cells(dRow, "c")
End If
Next sRow
MsgBox sCount & " Significant rows copied", vbInformation, "Transfer Done"
End Sub
Bookmarks