Reset Dependent Drop-down in Excel (with a tiny bit of VBA)

Поділитися
Вставка
  • Опубліковано 12 гру 2018
  • Join 400,000+ professionals in our courses here 👉 link.xelplus.com/yt-d-all-cou...
    Learn how to reset a dependent drop-down list in Excel with a little bit of VBA. The problem we get with dependent data validation lists is that when you change the value of the first data validation, the value for the dependent data validation stays there until you activate the drop-down. This can be misleading. In this video, you will learn how to automatically reset the value of the dependent list to say "please select" the moment the value in the first drop-down list changes.
    ⬇️ DOWNLOAD the workbook here: pages.xelplus.com/reset-dropd...
    We do this with Excel VBA, using the change event procedure. The default worksheet procedure is Selection Change event. This triggers every time you change the active cell. It's more optimal in this case to use the worksheet change procedure and make sure that it only run if the value of a specific cell is changed. We don't want to trigger the change procedure every time any cell value is changed.
    The simple Excel macro show you how you can set it up from scratch. Once you're done, make sure you save the workbook as a macro-enabled workbook.
    LINKS to related videos:
    Dependent data validation in Excel: • Dependent Drop-Down Li...
    Dependent Combo Box: • This Excel Dependent C...
    VBA IF THEN Statement: • Excel VBA IF THEN Stat...
    VBA Message Box: • How to use the Message...
    Full VBA playlist on UA-cam: • Excel VBA & Macros Tut...
    ★ My Online Excel Courses (including VBA) ► www.xelplus.com/courses/
    ➡️ Join this channel to get access to perks: / @leilagharani
    👕☕ Get the Official XelPlus MERCH: xelplus.creator-spring.com/
    🎓 Not sure which of my Excel courses fits best for you? Take the quiz: www.xelplus.com/course-quiz/
    🎥 RESOURCES I recommend: www.xelplus.com/resources/
    🚩Let’s connect on social:
    Instagram: / lgharani
    LinkedIn: / xelplus
    Note: This description contains affiliate links, which means at no additional cost to you, we will receive a small commission if you make a purchase using the links. This helps support the channel and allows us to continue to make videos like this. Thank you for your support!
    #excel #ExcelVBA

КОМЕНТАРІ • 220

  • @LeilaGharani
    @LeilaGharani  5 місяців тому

    Grab the file I used in the video from here 👉 pages.xelplus.com/reset-dropdown-file

  • @Alaska_Olympia
    @Alaska_Olympia 15 днів тому

    I'm flying through my assignments at work which will be making me look good, thanks to these tutorials. Thank you Leila!

  • @excelisfun
    @excelisfun 5 років тому +8

    Thanks for the amazing high quality video, as always ; )

    • @krn14242
      @krn14242 5 років тому

      Ditto. Very high quality video, easy code addition for great result.

    • @LeilaGharani
      @LeilaGharani  5 років тому +2

      Thank you for your wonderful comment teammate :)

  • @khinkey
    @khinkey 5 років тому +2

    I spend hours looking threw different peoples solutions from a google search and NOTHING was just this simple. This worked perfectly, and with the smallest amount of code I have seen yet. THANKS!!!!!

    • @LeilaGharani
      @LeilaGharani  5 років тому

      I'm glad to hear that. Glad it worked out.

  • @wayneedmondson1065
    @wayneedmondson1065 5 років тому +2

    Hi Leila.. excellent method to keep the user from being confused when the master drop-down changes. Thanks and Thumbs up!

  • @paragmahajan2538
    @paragmahajan2538 5 років тому +3

    Your videos are are rich source of conceptual knowledge.

  • @alcoolbc
    @alcoolbc 11 місяців тому

    I know this video was published quite a while ago, but it came in handy today helping me clean up dynamic drop down list issues (annoying CALC! error) and setting up filters via those multiple selections. Thanks, again.

  • @doorbs
    @doorbs 5 років тому

    Thank you so much for your wonderfully detailed yet easy to follow videos!! They have saved me so much time over the last few months. Have a wonderful Christmas and I look forward to more in 2019

  • @chamindabasnayake4844
    @chamindabasnayake4844 5 років тому

    Thank You! This tutorial gave a solution to a problem which I had since my first dependent dropdown list.

  • @ianmahoney560
    @ianmahoney560 5 років тому +1

    Thanks for the high quality videos, they have helped me tremendously.
    It would be fantastic if you could do some videos on creating a personal finance/budget spreadsheet. I'm sure a lot of people would highly regard it and learn a lot.
    Thanks.

  • @EduardoRibeiroEdu
    @EduardoRibeiroEdu 4 роки тому

    You are the best Leila!

  • @MalinaC
    @MalinaC 5 років тому +1

    Thank you for an awesome video and VBA fun! It is super cool, that validation doesn't validate VBA ;)

  • @sterne6
    @sterne6 5 років тому

    That‘s amazing. Thank you so much. Your video gives a solution to the problem which I have faced already many times with dependent drop-down lists, when the values were not changing automatically.

    • @LeilaGharani
      @LeilaGharani  5 років тому

      That's great! I'm happy to hear that :)

  • @IrfanKhan-wv8rh
    @IrfanKhan-wv8rh 2 роки тому

    Wow!! A very useful tips for us. Thank you so much ma'am. You are really good teacher.

  • @chiragverma9230
    @chiragverma9230 4 роки тому

    Awesome tutorial, saved my day. I have multiple dependent drop down. If one changes other subdependent cells should also change. So i have copied the code and pasted changing the target address and range adress. Kudos to you and your team 👍

    • @LeilaGharani
      @LeilaGharani  4 роки тому

      I'm glad the video was helpful for you.

  • @thedingdong4342
    @thedingdong4342 4 роки тому

    Thank you very much for the great tutorial. This is exactly what I've been looking for!

  • @nishchalraovelpula3632
    @nishchalraovelpula3632 4 роки тому

    Simply amazing, Thank you:)

  • @TroyAngeloii
    @TroyAngeloii 2 роки тому

    I'm your big fan. This vlog is a very big help on the report that I am doing. 👍👍👍

  • @vida1719
    @vida1719 5 років тому

    Perfectly explained as always.

  • @ckokse
    @ckokse 5 років тому +1

    Never thought I would ever try out VBA but with your guidance it actually is much less threatening.

  • @ExcelMadeEasy444
    @ExcelMadeEasy444 5 років тому

    Great Explained. Waiting what next tutorials brings.

    • @LeilaGharani
      @LeilaGharani  5 років тому

      Thank you Ashok. Looking forward to seeing you in the next ones too.

  • @danielrobertson3436
    @danielrobertson3436 10 місяців тому

    Great video. Very helpful

  • @neerajsahu2003
    @neerajsahu2003 Рік тому

    Really Thankful to you. You solved my big problem of excel.Again Thank You

  • @fatih.kocyildir
    @fatih.kocyildir Рік тому

    Thanks! this was very helpful.

  • @chrisr7694
    @chrisr7694 3 місяці тому

    Awesome, thank you.

  • @craigvoss1468
    @craigvoss1468 5 років тому

    Thank you for another great lesson.

    • @LeilaGharani
      @LeilaGharani  5 років тому

      You're welcome Craig. Thanks for dropping by :)

  • @sameersmulla
    @sameersmulla 2 роки тому

    Thanks for the Amazing video, It is helping us in depth....

  • @richardgrant4761
    @richardgrant4761 4 роки тому

    Big fan Leila! This was very helpful TY!

  • @TedimbcyBlogspot
    @TedimbcyBlogspot 2 роки тому

    Thank you for this video.

  • @lmajiedmary
    @lmajiedmary Рік тому

    Very much enjoyed!! Thank you!!

  • @davepower4434
    @davepower4434 4 роки тому

    This is rock n roll stuff. Thanks

  • @happytimecreations38
    @happytimecreations38 9 місяців тому

    You are awesome !

  • @lifeofkiran6285
    @lifeofkiran6285 2 роки тому

    thanks was scouring th internet and your videos for this solution!!!

  • @yulinliu850
    @yulinliu850 5 років тому

    Thanks Leila!

  • @dontbeafraid5313
    @dontbeafraid5313 5 років тому

    Great tutorial

  • @chriswilliamson7374
    @chriswilliamson7374 2 місяці тому

    Leila Thanks so much for making all the videos you do. You help so many people including me. I have a question related to DV lists and possible VB to click a button to reset a range of cells (that are DV lists) back to a specific choice. Any chance you can help me with that?

  • @russguppy8761
    @russguppy8761 5 років тому

    Excellent.

  • @Sukhvinder_Singh_Atwal
    @Sukhvinder_Singh_Atwal 9 місяців тому

    Thank you so much mam....😊👍👍

  • @christoskonstantinou1074
    @christoskonstantinou1074 Рік тому

    Hi Leila. GREAT tutorial! I would like to ask you how - using a macro - can I initialize the values in a number of 10 combo-boxes (i.e. to the value "Not answered" for all of them)

  • @JulieCooper-dk3zo
    @JulieCooper-dk3zo 2 місяці тому

    Amazing thank you! How can this apply to all lines in a table? this code only works on 1 cell. I also have several column with dependent drop down list that I would like to reset at the same time.

  • @zatak3689
    @zatak3689 4 роки тому

    Thanks a ton!! 💥💥💥💥💥💥💥💥💥💥

  • @alberthilt
    @alberthilt 3 роки тому +6

    Hi Leila! Great video!
    How do I get the VBA reset function to work on several rows?
    Thanks again!

  • @lisauda2209
    @lisauda2209 4 роки тому +6

    thank you so much for this tutorial. I have a question. if I want to make this VBA work for multiple dependent drop-down lists, what code should i add?

    • @ronellll
      @ronellll 4 роки тому +1

      Exactly what I want! but apparently she doesn't have that

    • @193_rohan5
      @193_rohan5 3 роки тому

      @@ronellll did you find the solution?

  • @jasonmanttan1756
    @jasonmanttan1756 4 роки тому

    Hi Leila - love the videos. I learn a lot. How to I reset a dependent dropdown if the original dropdown is in another sheet?

  • @desapoyment-xt1dh
    @desapoyment-xt1dh Рік тому

    All your videos are very helpful. Thank you so much.
    Can you also give tutorial if the dropdown list multple like 4 dropdown?

  • @wesleysuthern2307
    @wesleysuthern2307 5 років тому

    Good evening Leila, I have recently stumbled onto your videos and I've found them rather useful, so thank you. I have a question for you, that I'm hoping you can assist. I am in the middle of creating a database to (mostly) auto populate dollar figures based on a number of criteria. The dollar figures are based on the every day of the week, including weekends and public holidays. I managed to use the date range to populate individual cells that essentially provide the tally of weekdays/weekends in the given date range. I also managed to calculate the holidays that fall within that specific date range (although the date range will change, as the year progresses). This is where some of the Excel formula has me a bit stumped.
    It has me stumped because some of the public holidays in Australia fall on weekends and I can't seem to work out how to manipulate the formula that populates the individual cells that tally the weekdays/weekends whilst also recognising that a public holiday falls on one. It is a tad difficult to explain, so I hope the above is sufficient. The reason I'm seeking an answer to this is so I can, on another work sheet, input the relevant number of week days, weekend days and public holidays of a given date range, as the dollar calculations will be based on those.
    Thanks in advance,
    Wes.

  • @rakhisaxena4352
    @rakhisaxena4352 5 років тому

    Thank you!!!
    it was just a small mistake i was making which got sorted!!!!

  • @james_3854
    @james_3854 Місяць тому

    Would you be able to apply this type of logic to a form button, linked to a data validation list, that resets it to the first value (static value) each time you click the button?

  • @shetkar911
    @shetkar911 3 роки тому

    Thanks a lot

  • @omarmohamed3801
    @omarmohamed3801 5 років тому

    Thank You so much

  • @m1cannas
    @m1cannas 2 роки тому

    The best.

  • @vickyverukhia
    @vickyverukhia 3 роки тому

    Super 👍👍

  • @VishalPatel-lc8ty
    @VishalPatel-lc8ty 5 років тому +3

    Thank you so much for this. How would I set the original cell to also read "Please Select..." via VBA when the workbook is open?

  • @venkatbabu5866
    @venkatbabu5866 5 років тому

    Thank you so much mam.

    • @LeilaGharani
      @LeilaGharani  5 років тому

      You're very welcome. Thank you for your support.

  • @thiensuong5975
    @thiensuong5975 5 років тому

    Thankyou sis.

  • @supriyaprakash8253
    @supriyaprakash8253 4 роки тому +1

    Hi Leila ,I follow all your lessons. They are very useful and informative videos.
    I need help in resetting dependent drop-down list for entire column.
    Could you please share the related video link.

  • @jaymes93
    @jaymes93 5 років тому

    Thanks your videos helped a lot but ma'am I need help. I try taking the formula (from your previous video) and insert it into another sheet but it gives me an error. So my question is How do I take the formula (=OFFSET(F5,,,COUNTIF(F5:F14,"?*"))) and insert it into my source but in another sheet?

  • @pratik14jan
    @pratik14jan Рік тому

    Man i don't need a ux guy to design wireframes, if i learn these tricks i can create forms by myself completely in excel !!

  • @sumitvikram
    @sumitvikram 3 роки тому

    Hi Leila,
    Amazing video. Lately I have started following your videos and it has helped me on multiple occasions. Precisely what I needed.
    Thanks for it!
    Regarding this video, I applied the VBA logic on one row (no. 8), I have column "H" and "I" is dependent on H, further "J" is dependent on "I".
    Could you please guide me on how to fill down this logic for the entire range of 50?
    Thanks,
    Sumit

  • @shadkng
    @shadkng 5 років тому +7

    Hi, great video. How can I apply the vba to multiple rows? I generally add my data to a row and then copy down hundreds if rows. Thanks

    • @studioyumi
      @studioyumi 4 роки тому

      I'm having the same problem, did you already find a solution?

    • @guitari89
      @guitari89 4 роки тому

      I inputted the code from her example as "G6:G10" and the text applied to the subsequent rows until G10.

  • @bakthapuri
    @bakthapuri 4 роки тому

    Hi Leila..
    Your way of teaching is awesome as always.. I have a small request from my end " Could you please Make a video on Web scraping using VBA "... I also searched your video on web scraping in udemy as well but didn't find

  • @wq2746
    @wq2746 2 роки тому

    Nice, thanks
    🤔 wonder it will work on table row by row,

  • @SolomonKinyanjui_sk
    @SolomonKinyanjui_sk 5 років тому

    Thank you for this video. I was trying this procedure but I didn't use Target.Address. So every time I was getting error 1004

  • @yuvaprakashthulasimani5618
    @yuvaprakashthulasimani5618 4 роки тому

    Could you please explain how to grey out and enable list validation in excel from Editing. Thanks

  • @cheewaileong2192
    @cheewaileong2192 3 роки тому

    Is that a formula to choose the final drop-down list instead of going through from the first drop down?
    When chosen the second drop-down, the first will change to the consistent data as well. Thanks in advance

  • @BiniBall
    @BiniBall 2 роки тому

    sweet 10sec solution!

  • @alberthilt
    @alberthilt 3 роки тому

    Leila....thank you so much for all your tutorials.
    I am having trouble with this one though.
    It work great the first time I did it, but then I saved it(macro enabled file), now when I open the file again, it does not work.
    HELP!!!

  • @vipulhavale
    @vipulhavale 4 роки тому +1

    Thank you very much Leila..... But configure same to all the rows. For example i have to create a table with this system. ? please help.........

    • @193_rohan5
      @193_rohan5 3 роки тому

      did you find the solution?

  • @djdisasterjames
    @djdisasterjames 4 роки тому

    Hey, does this interfere with copy and paste operations? I read somewhere that Worksheet_Change and similar events can break copy and paste?

  • @SANDEEPKUMAR-xt8nc
    @SANDEEPKUMAR-xt8nc 5 років тому

    thank you mam. ...

  • @reshmajain7389
    @reshmajain7389 2 роки тому

    For me it's changing value even on just moving the cursor to the Target cell, even before taking any action of changing the dropdown value. This is working fine in ur video though

  • @gilberttan8523
    @gilberttan8523 5 років тому

    Hi Leila, can you advise if this works with earlier version of Excel? I have created and I find it doesn't work with 2007 Excel despite Macro has been enabled. Is there anything we can do to cater for all users?

  • @ArtByDesign80
    @ArtByDesign80 Рік тому

    Great video but what is the formula for VBA if you need to apply to an entire column not just two cells?

  • @SergoSS79
    @SergoSS79 3 роки тому

    Great Video and finally I found how to solve this. But instead of "Please select..." I would like to use first value in a new drop down list. How should I change the code in this case? Thanks!

  • @amit12000
    @amit12000 5 років тому

    Great

  • @user-oc5ko6gs5t
    @user-oc5ko6gs5t 5 років тому

    Nice video mam

    • @LeilaGharani
      @LeilaGharani  5 років тому

      Thank you Ankur :) Glad you like it.

  • @johirulislamnadeem
    @johirulislamnadeem 3 роки тому +1

    How this reset can be applied to all cells of a row??

  • @ashishranjan661
    @ashishranjan661 5 років тому +1

    Hi ma'am,
    really awesome videos made by you...which help us to learn Excel in a easy ways...
    please help me ...
    i have 10 drop-down list containing items.
    if i select item 1 from the first drop down.
    in second drop down list item option should start with item 2 ,item 3, item 4 . and so on
    How would this be possible... in Excel

  • @anupamkumar8987
    @anupamkumar8987 2 роки тому

    Amazing tips, thank you so much.
    How we can use it for multiple rows.
    Let's say I have a data validation drop down at E4:E200, how to used VBA code for that.
    could you please guide me on this?
    Thank you & keep rocking with your valuable content.

  • @userdude32
    @userdude32 4 роки тому

    Thanks for the tutorial. Why do you need to use $ for $G$4 but not for G6? Thanks.

  • @eanava
    @eanava 2 роки тому +1

    But what if you wanted to apply this trick to each row in a worksheet that had multiple rows? This solution only works for that first row. :(

  • @hosseinhosseinpoor4845
    @hosseinhosseinpoor4845 3 роки тому

    thanks..

  •  5 років тому

    Hi, Leila! How are you? I love your channel. I'm learning a lot with your content. I'm wondering if you may help me with an issue in VBA.
    My subroutine creates a new sheet and uses VBIDE Library to write an event SelectionChange in the sheet code. So, Creates Sheet>Insert SelectionChange code in it. The Code runs fine. The SelectionChange works great. However, after executing the sub, VBA opens automatically showing the sheet event code window and I don't know why and how to solve it. May you help me?

    •  5 років тому

      I solved partially the problem with Application.SendKeys "%{F4}" at the end of the subroutine. VBA doesn't stay open, but I see a flash when it is closing

  • @MrArmanrezaee
    @MrArmanrezaee 5 років тому

    Hi Leila, Thank you for your video. Can you please explain how to do the same thing when we have a ComboBox instead of Data Validation? Defining e.g. $G$4 doesn't work for when we have a ComboBox (DropDown1 for example) in our sheet.

    • @LeilaGharani
      @LeilaGharani  5 років тому

      A very simple way is to manipulate the cell links of the combo boxes. Right-mouse click on the first combo box and select "assign macro" - then click on New - you'll be taken to the change procedure. In this change procedure you can force the cell link value of the second combobox to become 1. So if the cell link of the 2nd combo box is in M4, you would type in Sheet2.Range("M4").Value = 1
      As the first category you could have the word "please select..." in your list.

    • @soumodeepneogi9924
      @soumodeepneogi9924 Рік тому +1

      @@LeilaGharani How do I get the VBA reset function to work on several rows?

  • @braddenyar3641
    @braddenyar3641 4 роки тому

    Strange but this doesn’t work for me in my sheet. I downloaded the version on line and it worked fine until I changed the inputs to named ranges - is there something else I need to do? Thx

  • @alirezamogharabi8733
    @alirezamogharabi8733 5 років тому

    Thank you Leila! Awesome solution, but Access forms has built in features for combo box like auto search or after update event that none programmer users can use it without any vba codes. VBA is very useful in MS ACCESS.
    Please make some videos about Power BI desktop. thanks a lot.

    • @LeilaGharani
      @LeilaGharani  5 років тому

      Thank you for your feedback Ali. Yes - BI added to my list for next year's videos :)

  • @Ps-pu3zx
    @Ps-pu3zx 4 роки тому

    How do i change the ListFillRange in a ComboBox with a Macro by clicking on a option Button

  • @vapesmarter24
    @vapesmarter24 2 роки тому

    is there a similar training video for this function for GOOGLE SHEETS?

  • @obernaltablet
    @obernaltablet 3 роки тому

    Your explnatin works fine for a 2 depaendant list, how to do it for 3 dependant lists?

  • @afzaalahmed9565
    @afzaalahmed9565 4 роки тому

    Thanks, . . . . mam, can we jump from one sheet to another from drop down list??

    • @emre318
      @emre318 4 роки тому

      Let's say drop down is in G2
      If Range("G2"). Value = sheet2 then Sheets("Sheet2").activate

  • @michaelstraus6307
    @michaelstraus6307 3 роки тому

    Just discovered and LOVE your videos. Question - Do you have a video for "Resetting Dependent Drop-Down" in Google Sheets? Thanks!

    • @FlameBeast25
      @FlameBeast25 2 дні тому +1

      Did you find a video or figure out a solution?

  • @nvalencia-kg2ws
    @nvalencia-kg2ws Місяць тому

    what if I need to write this for multiple cells?

  • @saudalbakhit9541
    @saudalbakhit9541 Рік тому

    how can i do this to multiple range like in a table rather than one cell?

  • @viktorija21
    @viktorija21 5 років тому +1

    Great tutolial, thanks! However, id doesn't work. What coudl be the reasons for that? I have a macro enabled excel and did all as per tutorial, but the dependent drop-down doesn't update.

    • @misso5369
      @misso5369 4 роки тому

      I am having the same problem it's so annoying. Even the steps prior to that work with the cell reference appearing in a message pop up box. But this particular VBA code just doesn't execute even though it's exactly the same with the cell references updated. HELP! :(

    • @emre318
      @emre318 4 роки тому

      I had the same issue, couldn't find why. Probably it's related to some kind of version differences.
      How I solved this problem was recording a macro. My Excel didn't accept changing drop down list's value by referring to it such as Range("A2"). Value = blablabla. - assume A2 is the range where you drop down list located.
      So I enabled macro recorder and wrote the value in drop down list's cell and checked how recorder writes the code. Then I changed the value as excel did and it worked.
      I don't remember the code and I can't check it since I'm on mobile but you can check it on your own.

  • @belknou6128
    @belknou6128 5 років тому +1

    can you help me i need to do this with multi columns not just on cell plz help me

    • @crystalnitsckie5257
      @crystalnitsckie5257 11 місяців тому

      Hi did you get the solution yet? If so, please share it with me? I am stuck...... Thanks

  • @simoocy7948
    @simoocy7948 5 років тому +2

    Hi., Thanks for the great video.
    But may i know how to apply to all rows?

    • @YoginderKrSingh
      @YoginderKrSingh 3 роки тому

      Hi Siti, Did you got the solution of this issue. I am looking fro same solution

    • @193_rohan5
      @193_rohan5 3 роки тому

      @@YoginderKrSingh any update on this?

    • @YoginderKrSingh
      @YoginderKrSingh 3 роки тому

      @@193_rohan5 write me back on kumar.yogindersingh@gmail.com

    • @crystalnitsckie5257
      @crystalnitsckie5257 11 місяців тому

      I have the same problem. Did you find a solution yet?

  • @gourabghoshroy7484
    @gourabghoshroy7484 3 роки тому

    Mam, Great Video. But is there any VBA where we can change a drop down list based on only value (not data validation) in another cell? Helpful if you present this video.

  • @williamriley3125
    @williamriley3125 9 місяців тому

    how does this apply to a range? you have one list that's being reset, but i have many. column a & b, 18 rows. validation A would reset validation B in each row :/

  • @pandudasari7549
    @pandudasari7549 11 місяців тому

    Please pleaee provide the same reset solution, without using VBA as macro is not working in free online office 365.

  • @nagavamsikrishna5242
    @nagavamsikrishna5242 3 роки тому

    Hi thank you for the video. I tried it is not happening ... Not showing "Please Select in the target cell. "Message box" option worked. Help me. please.