Hello.
I have an excel userform code that copy each row that match with
I would like to add a If function that skip or delete the row fit with the actual date or futur date from the actual day.
I've start from this
To this
Anyone could give me a tips ?
I have an excel userform code that copy each row that match with
VBA Code:
If I.Value2 = "Chicou" Then
I've start from this
Code:
With Workbooks("data_dump.xlsx").Worksheets("Chicou") 'reference target sheet
For Each I In Workbooks(NDR_FileName).Worksheets("Notes").Range("A6:A10000") 'loop through Sheet9 "A2:A1000" cells
If I.Value2 = "Chicou" Then
I.EntireRow.Copy
.Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues ' all “dots” are making following members/object referencing the object referenced in “With...”
End If
Next
End With
To this
VBA Code:
With Workbooks("data_dump.xlsx").Worksheets("Chicou") 'reference target sheet
For Each I In Workbooks(NDR_FileName).Worksheets("Notes").Range("A6:A10000")
If I.Value2 = "Chicou" Then
If Cells.Range("F", I) <= Date Then
'This row with F column fit with the actual date OR futur, do nothing, skip.
Else
'Copy row.
I.EntireRow.Copy
.Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
End If
End If
Next
End With
Anyone could give me a tips ?