Hi,
In column A I have "reported period" and in column C I have "account name". Each month I have new series data contains reported period and account name, and now I want to select MAX date for looking account.
Example:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Reported Period (column A)[/TD]
[TD]Account Name (column C)[/TD]
[/TR]
[TR]
[TD]12/09/2014[/TD]
[TD]Audi[/TD]
[/TR]
[TR]
[TD]12/09/2014[/TD]
[TD]BMW[/TD]
[/TR]
[TR]
[TD]12/09/2014[/TD]
[TD]VW[/TD]
[/TR]
[TR]
[TD]09/10/2014[/TD]
[TD]Audi[/TD]
[/TR]
[TR]
[TD]09/10/2014[/TD]
[TD]BMW[/TD]
[/TR]
[TR]
[TD]09/10/2014[/TD]
[TD]FORD[/TD]
[/TR]
</tbody>[/TABLE]
Max date for Audi, BWM is 09/10/2014, but for VW is 12/09/2014.
but something is wrong....
In column A I have "reported period" and in column C I have "account name". Each month I have new series data contains reported period and account name, and now I want to select MAX date for looking account.
Example:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Reported Period (column A)[/TD]
[TD]Account Name (column C)[/TD]
[/TR]
[TR]
[TD]12/09/2014[/TD]
[TD]Audi[/TD]
[/TR]
[TR]
[TD]12/09/2014[/TD]
[TD]BMW[/TD]
[/TR]
[TR]
[TD]12/09/2014[/TD]
[TD]VW[/TD]
[/TR]
[TR]
[TD]09/10/2014[/TD]
[TD]Audi[/TD]
[/TR]
[TR]
[TD]09/10/2014[/TD]
[TD]BMW[/TD]
[/TR]
[TR]
[TD]09/10/2014[/TD]
[TD]FORD[/TD]
[/TR]
</tbody>[/TABLE]
Max date for Audi, BWM is 09/10/2014, but for VW is 12/09/2014.
Code:
RP_SET = "01/01/2010"
For g = 2 To rowdata_lr
If wsRD_M.Range("C" & g).Value = looking_cust Then
RP = wsRD_M.Range("A" & g).Value
If RP_SET < RP Then
NEW_RP = RP
End If
End If
Next g
but something is wrong....