asyamonique
Well-known Member
- Joined
- Jan 29, 2008
- Messages
- 1,286
- Office Version
- 2013
- Platform
- Windows
Good Day,
Below code is filtering the whole data base on below table sample cell K1 value from same worksheet.
So far everything is good with that code .
Is it possible to add a more function for filterin on monthly basis.
Datas will be on worksheet1 as in below format and filtering function will be on worksheet2
On worksheet1 cell A1 I will simply put as list data validation for the months from jan to dec.
When I select to month from A1 as October, I want from customer ID's will load individually, not all will show up.
With sample below if October selected only 4 customers names will load with the code given above.
Many thanks.
Below code is filtering the whole data base on below table sample cell K1 value from same worksheet.
So far everything is good with that code .
VBA Code:
Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To LR
With Range("A" & i)
If .Value = Range("k1").Value Then
.Offset(, 1).Resize(, 3).Copy
Range("m" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
End If
End With
Next i
Application.ScreenUpdating = True
Range("K1").Select
ThisWorkbook.Save
Is it possible to add a more function for filterin on monthly basis.
Datas will be on worksheet1 as in below format and filtering function will be on worksheet2
On worksheet1 cell A1 I will simply put as list data validation for the months from jan to dec.
When I select to month from A1 as October, I want from customer ID's will load individually, not all will show up.
With sample below if October selected only 4 customers names will load with the code given above.
Many thanks.
Date | Customer ID | Name & Surname |
10-Oct | 12359 | xxxxxx |
10-Oct | 12359 | xxxxxx |
10-Oct | 12359 | xxxxxx |
10-Oct | 12359 | xxxxxx |
10-Oct | 12359 | xxxxxx |
10-Oct | 4395 | xxxxxx |
10-Oct | 4395 | xxxxxx |
10-Oct | 4395 | xxxxxx |
10-Oct | 4395 | xxxxxx |
11-Oct | 4395 | xxxxxx |
11-Oct | 4395 | xxxxxx |
11-Oct | 20491 | xxxxxx |
11-Oct | 20491 | xxxxxx |
11-Oct | 20491 | xxxxxx |
11-Oct | 20491 | xxxxxx |
11-Oct | 18426 | xxxxxx |
12-Oct | 18426 | xxxxxx |
12-Oct | 18426 | xxxxxx |
12-Oct | 18426 | xxxxxx |
12-Oct | 18426 | xxxxxx |
12-Oct | 18426 | xxxxxx |