Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Peter
Try this tester Header in A6:C6 Dates in A7:A1000 data in B7:C1000 We use A1:A2 for the criteria A1= always empty a2 = the code insert the formula in this cell On the user form ListBox2 = years and ListBox2 = months Note: numbers and not Jan, Feb If you want that you can use the index The try this button on the userform Private Sub CommandButton1_Click() Range("A2").Formula = "=AND(YEAR(A7)= " & Me.ListBox2.Value & ",MONTH(A7)=" & Me.ListBox1.Value & ")" Range("A6:C1000").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _ Range("A1:A2"), Unique:=False End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Peter" wrote in message oups.com... The operator selects the month and the year from 2 list boxes on a userform. This is then turned into two variables. I hope this makes sense, and thanks again! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Date(Year,Month,Day) not returnign correct date | Excel Discussion (Misc queries) | |||
count month when date is in day/month/year format | Excel Worksheet Functions | |||
=DATE(YEAR(P4),MONTH(P4)+1,1) | Excel Worksheet Functions | |||
Tell me which "season" (Month/Day through Month/Day) a date(Month/Day/Year) falls in (any year)??? | Excel Discussion (Misc queries) | |||
Sort month/date/year data using month and date only | Excel Discussion (Misc queries) |