HI Irobbo314,
Thanx for the code. how ever I tried it but it keeps on giving me the date in the first row. You will see I edited the code..
Sub FilterMaxDate()
Dim R As Range: Set R = Range("F:F").CurrentRegion
Dim MaxDate As Date: MaxDate = Application.Max(R.Columns(R.Columns.Count))
R.AutoFilter Field:=6, Criteria1:=MaxDate
End Sub
And the other problem I have is that there is a lot of data on the machine that has the same date.
Here is a sample of what I have.
[TABLE="width: 367"]
<colgroup><col span="4"><col></colgroup><tbody>[TR]
[TD]Section[/TD]
[TD]Machine[/TD]
[TD]Component[/TD]
[TD]Severity[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\BOOSTER\PUMP[/TD]
[TD]NORMAL[/TD]
[TD]2018/07/18[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\RH\SEC\CON\REDR[/TD]
[TD]NORMAL[/TD]
[TD]2018/05/14[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\RH\SEC\CON\REDR[/TD]
[TD]NORMAL[/TD]
[TD]2018/07/18[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\RH\SEC\CON\REDR[/TD]
[TD]NORMAL[/TD]
[TD]2018/04/25[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\RH\SEC\CON\REDR[/TD]
[TD]NORMAL[/TD]
[TD]2018/06/03[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\L\RE\CUTT\GBX[/TD]
[TD]NORMAL[/TD]
[TD]2018/07/18[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147 [/TD]
[TD]CM\L\RE\CUTT\GBX[/TD]
[TD]NORMAL[/TD]
[TD]2018/06/03[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\L\RE\CUTT\GBX[/TD]
[TD]NORMAL[/TD]
[TD]2018/05/14[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\L\RE\CUTT\GBX[/TD]
[TD]NORMAL[/TD]
[TD]2018/04/25[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\RH\PRIM\CON\REDR[/TD]
[TD]NORMAL[/TD]
[TD]2018/06/03[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\RH\PRIM\CON\REDR[/TD]
[TD]NORMAL[/TD]
[TD]2018/07/18[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\RH\PRIM\CON\REDR [/TD]
[TD]NORMAL[/TD]
[TD]2018/04/25[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\HYD[/TD]
[TD]BORDERLINE[/TD]
[TD]2018/07/18[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\HYD[/TD]
[TD]NORMAL[/TD]
[TD]2018/06/04[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\HYD[/TD]
[TD]NORMAL[/TD]
[TD]2018/06/03[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\HYD[/TD]
[TD]NORMAL[/TD]
[TD]2018/05/14[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\HYD[/TD]
[TD]BORDERLINE[/TD]
[TD]2018/04/25[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\L\GATH\ARM[/TD]
[TD]NORMAL[/TD]
[TD]2018/05/14[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\L\GATH\ARM[/TD]
[TD]NORMAL[/TD]
[TD]2018/06/03[/TD]
[/TR]
</tbody>[/TABLE]
And this is what I want:
[TABLE="width: 367"]
<colgroup><col span="4"><col></colgroup><tbody>[TR]
[TD]Section[/TD]
[TD]Machine[/TD]
[TD]Component[/TD]
[TD] Severity[/TD]
[TD] Date[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\BOOSTER\PUMP [/TD]
[TD] NORMAL [/TD]
[TD] 2018/07/18[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\RH\SEC\CON\REDR[/TD]
[TD] NORMAL[/TD]
[TD] 2018/07/18[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\L\RE\CUTT\GBX[/TD]
[TD] NORMAL[/TD]
[TD] 2018/07/18[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\RH\PRIM\CON\REDR[/TD]
[TD] NORMAL[/TD]
[TD] 2018/07/18[/TD]
[/TR]
[TR]
[TD]P33[/TD]
[TD]CM0147[/TD]
[TD]CM\HYD[/TD]
[TD] BORDERLINE[/TD]
[TD] 2018/07/18[/TD]
[/TR]
</tbody>[/TABLE]