filter data between two dates on Listbox userform

sofas

Active Member
Joined
Sep 11, 2022
Messages
468
Office Version
  1. 2019
Platform
  1. Windows
hello..Help us to add the ability to filter data between two dates on Listbox userform
Everything works fine, I just have to choose the first and last date from the combobox.


Screenshot 2023-02-05 124813.png
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi,

You do have a ComboBox for your End Date ... but where exactly is your ComboBox for your StartDate ... or is it pre-defined ?
 
Upvote 0
Hi,

You do have a ComboBox for your End Date ... but where exactly is your ComboBox for your StartDate ... or is it pre-defined ?
Hello. I have one for filtering data with the date condition. I want to change it so that I can filter between two dates. I added a new fin date combobox to select the last date

To get a combo box for the first date and another for the last date
 
Upvote 0
Hello,

Do you mean that, in your UserForm, Date is your combobox FROM ... and that Fin Date is your combobox TO ....???
 
Upvote 0
Hi Sofas,

your sheet has a link between listbox and a table, could you try manipulate a filter of the table and after update the listbox... something like...

Sub filterData()
' filterData

ActiveSheet.ListObjects("Table2").Range.AutoFilter Field:=2, _
Criteria1:=">=" & DataInicio, _
Operator:=xlAnd, _
Criteria2:="<=" & DataFin

End Sub
 
Upvote 0
Hi Sofas,

your sheet has a link between listbox and a table, could you try manipulate a filter of the table and after update the listbox... something like...

Sub filterData()
' filterData

ActiveSheet.ListObjects("Table2").Range.AutoFilter Field:=2, _
Criteria1:=">=" & DataInicio, _
Operator:=xlAnd, _
Criteria2:="<=" & DataFin

End Sub
Thank you for taking care of my request. The problem is that I am not an expert in programming. Can you add it to the attached file for the experiment
 
Upvote 0

Forum statistics

Threads
1,214,797
Messages
6,121,629
Members
449,041
Latest member
Postman24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top