Result in list box depending on condition

jimpatel1993
2StarLounger
Posts: 153
Joined: 31 Jan 2021, 09:12

Result in list box depending on condition

Post by jimpatel1993 »

Hi
Thanks a lot again for looking at my post.
Really apologies as I need to attach my query in word document as I need to go thorough few examples.
Any help will be much appreciated and thanks again for this forum and kind people for help.

Jim
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78407
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Result in list box depending on condition

Post by HansV »

I don't understand Example 3. What do you mean by "Because there is no james and ryan for name Rohit(ZS22)"?
Best wishes,
Hans

jimpatel1993
2StarLounger
Posts: 153
Joined: 31 Jan 2021, 09:12

Re: Result in list box depending on condition

Post by jimpatel1993 »

Thanks for your reply Hans
What I mean is if you filter excel sheet to name Rohit(ZS22) you won't find any James or Ryan under Rohit(ZS22)
Hope I made sense. Pls let me know if it is not clear. I will explain more about logic.
Thanks a lot Hans

User avatar
HansV
Administrator
Posts: 78407
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Result in list box depending on condition

Post by HansV »

Huh?

S0781.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

jimpatel1993
2StarLounger
Posts: 153
Joined: 31 Jan 2021, 09:12

Re: Result in list box depending on condition

Post by jimpatel1993 »

Sorry hans
I think that's is wrong excel may be. I have attached the updated now.
Really sorry for this trouble.
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78407
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Result in list box depending on condition

Post by HansV »

Yes, that's different. I'll get back to you.
Best wishes,
Hans

jimpatel1993
2StarLounger
Posts: 153
Joined: 31 Jan 2021, 09:12

Re: Result in list box depending on condition

Post by jimpatel1993 »

Really sorry about that
Thanks a lot Hans

User avatar
HansV
Administrator
Posts: 78407
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Result in list box depending on condition

Post by HansV »

See the attached version. I added Rajor (400) to the source list of listbox1 (you had James twice).

Conditions (1).xlsm
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

jimpatel1993
2StarLounger
Posts: 153
Joined: 31 Jan 2021, 09:12

Re: Result in list box depending on condition

Post by jimpatel1993 »

Fantastic Hans
Thanks a lot for your time and effort
Really appreciated

jimpatel1993
2StarLounger
Posts: 153
Joined: 31 Jan 2021, 09:12

Re: Result in list box depending on condition

Post by jimpatel1993 »

Hans
Really fantastic work. Thanks a lot.
Just one question. Do you know how to give space between each result?
That is Andy, James and Ryan results are coming together in Andy row. Any idea pls?
Thanks again

User avatar
HansV
Administrator
Posts: 78407
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Result in list box depending on condition

Post by HansV »

Sorry, can you explain in more detail what you want?
Best wishes,
Hans

jimpatel1993
2StarLounger
Posts: 153
Joined: 31 Jan 2021, 09:12

Re: Result in list box depending on condition

Post by jimpatel1993 »

Sure
I have attached 2 example query.

Thanks a lot Hans
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78407
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Result in list box depending on condition

Post by HansV »

Would it be OK to use a text box instead of a list box?
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78407
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Result in list box depending on condition

Post by HansV »

Or even better, three separate text boxes?
Best wishes,
Hans

jimpatel1993
2StarLounger
Posts: 153
Joined: 31 Jan 2021, 09:12

Re: Result in list box depending on condition

Post by jimpatel1993 »

That will be perfect I guess
Thanks Hans

User avatar
HansV
Administrator
Posts: 78407
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Result in list box depending on condition

Post by HansV »

See the attached version.

Conditions (1).xlsm
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

jimpatel1993
2StarLounger
Posts: 153
Joined: 31 Jan 2021, 09:12

Re: Result in list box depending on condition

Post by jimpatel1993 »

That's great
Fantastic
Thanks a lot for your effort Hans
Much appreciated

jimpatel1993
2StarLounger
Posts: 153
Joined: 31 Jan 2021, 09:12

Re: Result in list box depending on condition

Post by jimpatel1993 »

Hi Hans
Sorry to ask you one more question
Is it possible to show only filtered items in time sheet.
That is
Example
When user select Andy(v110) and Rajor (400)
The time sheet will show only those two related names and rest will be hidden.
Example 2
When user select Rohit(ZS22) James (B200K) And Andy (v100) then sheet named as time will auto filter to those 3 names only.
Any possibility please and really sorry for this question.

User avatar
HansV
Administrator
Posts: 78407
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Result in list box depending on condition

Post by HansV »

Here it is with the added code.

Conditions (1).xlsm
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

jimpatel1993
2StarLounger
Posts: 153
Joined: 31 Jan 2021, 09:12

Re: Result in list box depending on condition

Post by jimpatel1993 »

Great
Thanks a lot for your kind help