Problem search data by selected combobox & datepicker tools
Solved/Closed
abdelfatah_0230
Posts
73
Registration date
Thursday 18 July 2019
Status
Member
Last seen
23 July 2022
-
5 Jul 2020 à 16:39
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 23 Jul 2020 à 10:47
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 23 Jul 2020 à 10:47
Related:
- Problem search data by selected combobox & datepicker tools
- Pro tools free download - Download - Musical production
- Tmobile data check - Guide
- Vim search - Guide
- Daemon tools securom - Guide
- Yahoo search history - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
6 Jul 2020 à 11:51
6 Jul 2020 à 11:51
Hi Abdel,
You are setting your sheet incorrectly in the beginning of the Initialize part:
Set sh = sheet1
should be:
Set sh = Sheets("sheet1")
Not sure why you don't get an error for that.
Edit: Tried "Set sh = sheet1" in a simple test code and it worked. When I run your code, I'm getting a compiling error, saying that a variable is not defined and the "sheet1" text is highlighted. When I change "sheet1" into "Sheets("sheet1")", the error is gone.
PS: When posting codes, could you use the drop down arrow attached to the code button you would normally click and select "basic". This will make your code look like it is in VBA and makes it easier to reference code lines, since they are numbered.
Best regards,
Trowa
You are setting your sheet incorrectly in the beginning of the Initialize part:
Set sh = sheet1
should be:
Set sh = Sheets("sheet1")
Not sure why you don't get an error for that.
Edit: Tried "Set sh = sheet1" in a simple test code and it worked. When I run your code, I'm getting a compiling error, saying that a variable is not defined and the "sheet1" text is highlighted. When I change "sheet1" into "Sheets("sheet1")", the error is gone.
PS: When posting codes, could you use the drop down arrow attached to the code button you would normally click and select "basic". This will make your code look like it is in VBA and makes it easier to reference code lines, since they are numbered.
Best regards,
Trowa

7 Jul 2020 à 15:14
this is my file
https://www.dropbox.com/scl/fi/a4k54obah2x8uk43faouu/xc.xls?dl=0&rlkey=jlu45cec2s08mbofrp13ywbyk
14 Jul 2020 à 11:51
Looking at your file I notice that the left DatePicker is called DTPicker2 and the right one DTPicker1. So to display results in the listbox, we have to change the right DatePicker to select a start date before the dates in you table. Your file works fine for me.
But you probably did that on purpose, since I remember you having your entire sheet reversed.
The other thing that I can think of, is that you don't have the right references activated. You probably already used this, otherwise DatePicker wouldn't show. Top menu of VBA, Tools > References.
These are the references checked for my Excel:
Since there is an Object in the code, make sure the 3 references mentioning Object are checked.
Hopefully that solves it.
Best regards,
Trowa
16 Jul 2020 à 14:57
23 Jul 2020 à 10:47