+ Reply to Thread
Results 1 to 20 of 20

System for offering special merchandise based on selection in drop-down box VBA?

  1. #1
    Registered User
    Join Date
    03-09-2017
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    19

    System for offering special merchandise based on selection in drop-down box VBA?

    Hi all,

    And thanks for having a look.

    I made an attachment for you to have a look at.

    What i need is to have an easy dropdown for products to be offered. (in place)
    If i selected it, it does not showing in the "Optionally offered" but these prices should have a deduction of the price if the product has something shown in the same productgroup.

    As it are arrays in sheet3, and the data is the same in Sheet2, i think it should be possible. However its my skills in Excel that lack to create something beautiful.

    Hope i can rely on your support to create something awesome for my customers, and wow my colleagues..

    Thanks in advance!
    Attached Files Attached Files
    Last edited by AliGW; 04-12-2017 at 09:02 AM. Reason: Refined title again based on more information regarding the query

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Again vlookups, whatif, and dropdown

    You might also want to attach a spreadsheet that shows what you have and what you want.
    (Go Advanced>Manage Attachments)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    03-09-2017
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    19

    Re: Again vlookups, whatif, and dropdown

    Thank you for your aiding ChemistB, but the button for adding an attachment doesnt work properly.

    Checked it in multiple browser now, Explorer and Chrome, both dont work.

    Cant add attachment, please have a look if you can replicate same issue?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,843

    Re: Again vlookups, whatif, and dropdown

    You will be able to upload your workbook like this:

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    then you will get help. However, this will not be until you have changed your thread title to something clearly explicit of the problem you are facing. Thanks for your compliance.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    03-09-2017
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    19

    Re: Again vlookups, whatif, and dropdown

    Added worksheet
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,843

    Re: Help with setting up a drop-down box to select items in workbook

    As a courtesy, I have re-opened the thread, altered its title for you (next time you must give an appropriate title yourself) and de-cluttered it.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,843

    Re: Help with setting up a drop-down box to select items in workbook

    I have had a look at your workbook, and I am not clear about what you want given your expected outcomes. I understand that you want to offer other products, I think at a discount, based on the choices made in the selection box above, but don't understand why nothing from the C range is offered. My concern is that a formulaic approach will be unwieldy, as i doubt the real data is just three categories with just five products in each - am I correct? I think you will need a VBA solution. Would you like me to move the thread to the correct section and flag it as a VBA query?

  8. #8
    Registered User
    Join Date
    03-09-2017
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    19

    Re: Help with setting up a drop-down box to select items in workbook

    You have understood correctly:
    "I think at a discount, based on the choices made in the selection box above"


    I have, in the real situation, like 8 productgroups with 6 products each.
    Due to my lacking skills of Excel im not sure at all how to reach a solution. Appreciating your help; if you think its VBA then yes; please do move it.

    I will, start to look into VBA and Excel so that when help arrives, i know what i have to do.

    Again, thanks a lot for your time and effort Ali!

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,843

    Re: System for offering special merchandise based on selection in drop-down box

    I think so, so here we go - I'm moving the thread!

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,843

    Re: System for offering special merchandise based on selection in drop-down box VBA?

    OK - thread moved and request posted in the Call in the Cavalry thread - let's hope someone can sort you out.

  11. #11
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: System for offering special merchandise based on selection in drop-down box VBA?

    IF I'm understanding your objective correctly, I think you can do this formulaically. The following should be array entered (confirm with Ctrl + Shift + Enter instead of Enter):

    In F14: =VLOOKUP(E14,Blad3!$F$4:$G$9,2,FALSE)-SUM(IF(COUNTIF(Blad3!$F$4:$F$8,$E$4:$E$9)>0,$F$4:$F$9))

    Fill down

    In F21: =VLOOKUP(E21,Blad3!$I$4:$J$9,2,FALSE)-SUM(IF(COUNTIF(Blad3!$I$4:$I$8,$E$4:$E$9)>0,$F$4:$F$9))

    Fill down

    Use a similar setup for your other groups. As you mentioned, conditional formatting can be used to make the desired row appear blank. Let me know if you need assistance with that.

    Take a look at the attachment to see if it will suffice:
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    03-09-2017
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    19

    Re: System for offering special merchandise based on selection in drop-down box VBA?

    Very close!

    (my bad
    Yet; if i select A1 and A2 and so on, both in the upper part and in the lower part, it should return 0 on them.
    A1 - A1 should be 0
    A2 - A2 should be 0
    B1 - B1 should be 0
    B2 - B2 should be 0

    And so on.

    Very close!

    Thanks CAntosh!

  13. #13
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: System for offering special merchandise based on selection in drop-down box VBA?

    Alternatively, you could use (also array-entered):

    F14: =INDEX(Blad2!$F$3:$F$18,MATCH(E14,All_Products,0))-SUM(IF(COUNTIF(A_Products,$E$4:$E$9)>0,$F$4:$F$9))

    F21: =INDEX(Blad2!$F$3:$F$18,MATCH(E21,All_Products,0))-SUM(IF(COUNTIF(B_Products,$E$4:$E$9)>0,$F$4:$F$9))

    This set up is a little easier to adjust for your different groups.

  14. #14
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: System for offering special merchandise based on selection in drop-down box VBA?

    I'm not sure I understand. Do you mean if you select two products from the same group? What value should be shown then? Based on your expected values, it looks like the bottom part should show the added cost of swapping out one choice for the alternative. Could you please provide a new set of expected values for the scenario you're describing?

    Keep in mind that the bottom values will appear blank if they're chosen, so the lower part should not matter much for selected products.

    Take a look at the updated attachment and please try to give me a clearer idea of what I'm misunderstanding.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    03-09-2017
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    19

    Re: System for offering special merchandise based on selection in drop-down box VBA?

    I will rework my quoting tool to match it like this, i will manage!

    Thank your very much for helping me out!

    Both to you and Ali, my appreciation will be shared through rating system.

    Thanks again!

  16. #16
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: System for offering special merchandise based on selection in drop-down box VBA?

    Glad to help, please let us know if you have any difficulty adapting your workbook.

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,843

    Re: System for offering special merchandise based on selection in drop-down box VBA?

    Glad to see that it's resolved - well done, CAntosh!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  18. #18
    Registered User
    Join Date
    03-09-2017
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    19

    Re: System for offering special merchandise based on selection in drop-down box VBA?

    Allright, i jumped the gun.

    My expected outcomes arent what i was looking for.

    I uploaded the file created by CAntosh, reworked the expected outcomes.

    thanks in advance, again and once more :D
    Attached Files Attached Files

  19. #19
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: System for offering special merchandise based on selection in drop-down box VBA?

    I see now. I didn't realize the lower boxes might only contain a few select entries. It looks like the formulae just need to be wrapped in an IF clause. Try the following (array-entered):

    In F14: =IF(OR($E14="",COUNTIF($E$4:$E$9,$E14)>0),"",VLOOKUP(E14,Blad3!$F$4:$G$9,2,FALSE)-SUM(IF(COUNTIF(Blad3!$F$4:$F$8,$E$4:$E$9)>0,$F$4:$F$9)))

    In F21: =IF(OR($E21="",COUNTIF($E$4:$E$9,$E21)>0),"",VLOOKUP(E21,Blad3!$I$4:$J$9,2,FALSE)-SUM(IF(COUNTIF(Blad3!$I$4:$I$8,$E$4:$E$9)>0,$F$4:$F$9)))
    Attached Files Attached Files

  20. #20
    Registered User
    Join Date
    03-09-2017
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    19

    Re: System for offering special merchandise based on selection in drop-down box VBA?

    This is it!

    Man, I envy people like you; making this up so easily!

    Thanks a great lot! :D

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Clear up to three dependent drop down lists based on selection in superior drop down list
    By theletterh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-04-2016, 09:31 PM
  2. [SOLVED] using SUMIFS and adding values based on multiple criteria based on selection from the drop
    By muheebrahman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-25-2015, 12:55 AM
  3. Replies: 1
    Last Post: 06-03-2013, 06:30 AM
  4. Replies: 3
    Last Post: 01-31-2013, 06:22 PM
  5. Based on Drop Down Selection...
    By exs120 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-17-2011, 02:22 AM
  6. Auto-update initial drop-down selection based on previous drop-downs
    By thornomad in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-16-2010, 09:55 AM
  7. controlling a form drop down based on selection of another drop down
    By flurry in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2006, 11:31 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1