Dazzawm
Well-known Member
- Joined
- Jan 24, 2011
- Messages
- 3,783
- Office Version
- 365
- Platform
- Windows
I have a list of data in column A & B on sheet 1. I need a macro to find the latest date in column A and add to sheet 2 for each corresponding number in column B onto sheet 2 please. Example below with highlighted last dates for each in yellow.
Result after code
It would be a help if sheet 2 was created also please.
EDIT:
I forgot to add row 14 and 26 in the examples.
SMP002.xlsx | ||||
---|---|---|---|---|
A | B | |||
1 | Date | Stock Code | ||
2 | 05/01/2024 | FP86410 | ||
3 | 10/01/2024 | FP86410 | ||
4 | 22/02/2024 | FP86410 | ||
5 | 29/02/2024 | FP86410 | ||
6 | 11/04/2024 | FP86410 | ||
7 | 25/04/2024 | FP86410 | ||
8 | 31/05/2024 | FP86410 | ||
9 | 31/05/2024 | FP86410 | ||
10 | 07/06/2024 | FP86410 | ||
11 | 11/01/2024 | FPAB1167 | ||
12 | 22/02/2024 | FPAB1167 | ||
13 | 04/04/2024 | FPAB1167 | ||
14 | 08/02/2024 | FPAB1196 | ||
15 | 25/01/2024 | FPAB1208 | ||
16 | 22/02/2024 | FPAB1208 | ||
17 | 28/02/2024 | FPAB1208 | ||
18 | 06/03/2024 | FPAB1208 | ||
19 | 07/03/2024 | FPAB1208 | ||
20 | 29/04/2024 | FPAB1208 | ||
21 | 10/05/2024 | FPAB1208 | ||
22 | 24/05/2024 | FPAB1208 | ||
23 | 24/05/2024 | FPAB1208 | ||
24 | 05/01/2024 | FPAB1212 | ||
25 | 22/02/2024 | FPAB1212 | ||
26 | 22/02/2024 | FPAB1246 | ||
27 | 04/04/2024 | FPAB1266 | ||
28 | 24/05/2024 | FPAB1266 | ||
29 | 07/02/2024 | FPAB1307 | ||
30 | 17/04/2024 | FPAB1307 | ||
31 | 11/01/2024 | FPAB1309 | ||
Sheet1 |
Result after code
SMP002.xlsx | ||||
---|---|---|---|---|
A | B | |||
1 | Date | Stock Code | ||
2 | 07/06/2024 | FP86410 | ||
3 | 04/04/2024 | FPAB1167 | ||
4 | 24/05/2024 | FPAB1208 | ||
5 | 22/02/2024 | FPAB1212 | ||
6 | 24/05/2024 | FPAB1266 | ||
7 | 17/04/2024 | FPAB1307 | ||
8 | 11/01/2024 | FPAB1309 | ||
Sheet2 |
It would be a help if sheet 2 was created also please.
EDIT:
I forgot to add row 14 and 26 in the examples.
Last edited by a moderator: