+ Reply to Thread
Results 1 to 5 of 5

Case statement based on value within drop-down box

  1. #1
    Registered User
    Join Date
    09-23-2013
    Location
    Gold Coast, Australia
    MS-Off Ver
    2010
    Posts
    50

    Case statement based on value within drop-down box

    Hey guys,

    I'm trying to run a Case statement that will check the value of a cell that contains a drop down box, and then either hide or unhide a specific row based on the result. I'm having all-sorts of trouble with it, and I'm sure it's pretty straight forward!

    H7:H16 is a range that contains a drop-down box where users select a string value representing a volumetric size.

    Please Login or Register  to view this content.
    I'm not even sure I'm supposed to put it in the Worksheet_Change Sub, or if half the lines of code I've got in there are even relevant. I ripped the code from another Case statement that actually works, but which relied on data entry to the cell, not drop-down boxes.

    I'm sure I've made a complete hash of it! Sorry for the mess.....

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Case statement based on value within drop-down box

    Your drop down box is spread across 10 cells? Select Case can only look at 1 value at a time.

  3. #3
    Registered User
    Join Date
    09-23-2013
    Location
    Gold Coast, Australia
    MS-Off Ver
    2010
    Posts
    50

    Re: Case statement based on value within drop-down box

    No, sorry for the confusion.

    The drop-down box is contained in one cell, but that drop-down box is replicated across that cell range. I really only need it to work on cell cell H7, but if I can cover the entire range of data entry points it would cover the error trapping issues I may encounter!

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Case statement based on value within drop-down box

    Then try changing the select case statement to
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-23-2013
    Location
    Gold Coast, Australia
    MS-Off Ver
    2010
    Posts
    50

    Re: Case statement based on value within drop-down box

    I dumbed it down, converted the strings to integers in the drop-down box and used If statements.

    I'd prefer Case statements so I could integrate them in other spreadsheets down the track, but this is working for me!

    Please Login or Register  to view this content.

+ 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. IF statement calculations based on drop-down lists
    By noobsaibot in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-25-2020, 07:03 PM
  2. Replies: 5
    Last Post: 07-19-2012, 02:53 AM
  3. A better Case (was "Create Loop with Case statement")
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-16-2009, 12:55 PM
  4. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM
  5. Switch(case) statement(enhanced if statement)
    By zapopaul in forum Excel General
    Replies: 6
    Last Post: 10-24-2008, 06:53 PM

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