+ Reply to Thread
Results 1 to 12 of 12

VBA to make a cell containing a dropdown list go blank when list selection changes in anot

  1. #1
    Registered User
    Join Date
    04-10-2024
    Location
    Melbourne, Australia
    MS-Off Ver
    MS365 2403
    Posts
    20

    VBA to make a cell containing a dropdown list go blank when list selection changes in anot

    Hello,

    This is so overwhelming.

    I have been using formula, =INDIRECT(SUBSTITUTE($B$11," ","_")&"(""COUPLING"""), which B1 represents the models as a drop down, and COUPLING was the name of a table which included all model names and measurements but was getting a #ref error message.

    Is there anyway for a dropdown list for the models, and then another drop down list for the measurements that change if a model has changed too?
    Last edited by AliGW; 04-12-2024 at 01:23 AM. Reason: Thread title improved.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,181

    Re: Need a VBA for formula to work

    Your title is wrong - you do not need VBA to make any formula work.

    I gave you a working formula in your previous thread, so why are you mentioning a non-working formula here?

    The question here is about making a cell go blank when the option in a drop-down is changed. I am going to edit your thread title, as it's completely misleading.

    I am also attaching my working solution for the benefit of anyone assisting.

    This is the question you asked that needs answering here:

    Is there anyway to get the measurement dropdown list to reset to blank after a new model has been changed?
    This is the bit that I said would require VBA.
    Attached Files Attached Files
    Last edited by AliGW; 04-11-2024 at 02:07 AM.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    04-10-2024
    Location
    Melbourne, Australia
    MS-Off Ver
    MS365 2403
    Posts
    20

    Re: VBA to make a cell containing a dropdown list go blank when list selection changes in

    Hi Ali,

    Thanks for the clarification. The helper column that you did worked a treat I just need some help with the VBA for the drop down on cell A6 to go blank once a new drop down on cell A5 has been changed
    Last edited by pmsherry; 04-11-2024 at 04:43 AM.

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

    Re: VBA to make a cell containing a dropdown list go blank when list selection changes in

    Yes - I know. Hopefully someone with VBA skills will step in.

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,024

    Re: VBA to make a cell containing a dropdown list go blank when list selection changes in

    Start by unmerging cell A6. You should avoid merging cells because they almost always cause problems for macros.
    Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Make a selection in A5.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  6. #6
    Registered User
    Join Date
    04-10-2024
    Location
    Melbourne, Australia
    MS-Off Ver
    MS365 2403
    Posts
    20

    Re: VBA to make a cell containing a dropdown list go blank when list selection changes in

    hi mumps1,

    unfortunately this code hasn't made the A6 cell blank when a new selection has been made in A5, even after unmerging cells

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,024

    Re: VBA to make a cell containing a dropdown list go blank when list selection changes in

    It worked for me on the file you posted. It would be easier to help and test possible solutions if you could attach a copy of your actual file. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary). See the yellow banner at the top of this page for instructions to attach a file.
    Last edited by Mumps1; 04-11-2024 at 09:29 AM.

  8. #8
    Registered User
    Join Date
    04-10-2024
    Location
    Melbourne, Australia
    MS-Off Ver
    MS365 2403
    Posts
    20

    Re: VBA to make a cell containing a dropdown list go blank when list selection changes in

    Hi mumps1,

    I have attached a file that AliGW helped with by using a helper formulas in column B.

    cell A5 is the dropdown list for all different model sizes, with cell A6 being the measurements of all the above different models. AliGW has managed to work out a helper formula to achieve A6 dropdown list, however I need a VBA code where A6 goes blank or back to the first option in row 6 when a new model is selected in A5.

    your code worked in my original document however, I didn't have any dropdowns in those cells.
    Attached Files Attached Files

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

    Re: VBA to make a cell containing a dropdown list go blank when list selection changes in

    I thought I'd made it clear in post #2 which workbook was relevant to this question. Obviously not, so to avoid any further confusion, I have removed the attachment to post #1.

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,024

    Re: VBA to make a cell containing a dropdown list go blank when list selection changes in

    In the file you posted, when I selected "21' FAMILY VAN" in A5, the contents of A6 were deleted to make A6 blank. The macro is working for me. Did you put the macro in the worksheet code module as I described in Post #5?
    Last edited by Mumps1; 04-12-2024 at 10:02 AM.

  11. #11
    Registered User
    Join Date
    04-10-2024
    Location
    Melbourne, Australia
    MS-Off Ver
    MS365 2403
    Posts
    20

    Re: VBA to make a cell containing a dropdown list go blank when list selection changes in

    awesome, this works now - thank so much

  12. #12
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,024

    Re: VBA to make a cell containing a dropdown list go blank when list selection changes in

    You are very welcome.

+ 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] Product formula does not work correctly. How to make it work?
    By JulianS96 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-06-2020, 06:23 AM
  2. Replies: 2
    Last Post: 01-31-2018, 08:49 AM
  3. [SOLVED] Need a COUNTIF formula to work with Excel 2000. Not confident it will work?
    By g1terra in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-06-2017, 01:59 AM
  4. [SOLVED] Work Planner with formula for work rotations
    By sorensjp in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-12-2017, 09:24 PM
  5. Replies: 0
    Last Post: 11-12-2012, 04:49 AM
  6. Trying to work formula for work TIME SHEET using IF formula
    By help_monique in forum Excel General
    Replies: 8
    Last Post: 10-12-2009, 11:46 PM
  7. Replies: 2
    Last Post: 11-30-2005, 06:15 PM

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