+ Reply to Thread
Results 1 to 8 of 8

Case Range Help

  1. #1
    Registered User
    Join Date
    06-13-2018
    Location
    Glasgow
    MS-Off Ver
    2013
    Posts
    33

    Angry Case Range Help

    I have a VBA function set up whereby certain cells are displayed after ALL dropdowns are selected from 3 cells (D5,D6(Misc 1 or Misc 2) and D7)

    I am looking to have 3 separate cases that return certain outcomes. For example, If D7 shows "CASE 1" this will only shows rows 15 & 19 (Row 17 will be hidden). If D7 shows "CASE 2" this will show rows 15 & 17 (19 will be hidden). Finally, if D7 shows "CASE 3" then this will show row 19 only (15 & 17 will be hidden).

    PS - D6 only has 2 options "MISC 1" and "MISC 2". If "MISC 1" is selected, row 26 will show. If "MISC 2" is selected row 26 will be hidden.

    I am also looking to add more options in i.e. "CASE 4,5,6,etc" that show and hide other rows but I'll tackle that another day.

    I have this VBA but it doesn't work for CASE 1. Could someone offer their advice? PPS - I am new to VBA and it pickles my head at times.

    Thanks.

    Please Login or Register  to view this content.
    Last edited by MonTheEck; 09-14-2018 at 04:16 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: Case Range Help

    Please edit your post and add code tags to the code.-
    -
    -
    AA CodeTags.jpg

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Case Range Help

    In addition to Davesexcel, attach an Excel sample file, it helps to debug
    - Battle without fear gives no glory - Just try

  4. #4
    Registered User
    Join Date
    06-13-2018
    Location
    Glasgow
    MS-Off Ver
    2013
    Posts
    33

    Re: Case Range Help

    Updated. Apologies.

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Case Range Help

    Is there a file attached ??

  6. #6
    Registered User
    Join Date
    06-13-2018
    Location
    Glasgow
    MS-Off Ver
    2013
    Posts
    33

    Re: Case Range Help

    Thanks for your help. I managed to sort it by simplifying everything. I think I had been looking at it for so long my eyes (and brain) were fried! (The joys of being a newbie to VBA! Thanks

  7. #7
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Case Range Help

    Based on your description and some code simplification, I think this does what you're after:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  8. #8
    Registered User
    Join Date
    06-13-2018
    Location
    Glasgow
    MS-Off Ver
    2013
    Posts
    33

    Re: Case Range Help

    Perfect. Thanks WBD

+ 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] Case or If statement to add value to range
    By rob_h in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-05-2017, 06:27 AM
  2. Select case on range name
    By mcinnes01 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-10-2011, 11:26 AM
  3. How to add range to Case Statement
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-20-2010, 01:50 PM
  4. Select Case in a Range
    By prairied0gg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-12-2010, 03:30 PM
  5. Select case using a range
    By sigfreid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-31-2009, 09:17 AM
  6. how to make this range in this case ?
    By vumian in forum Excel General
    Replies: 6
    Last Post: 08-17-2006, 11:15 AM
  7. [SOLVED] case select and a range
    By JT in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2005, 07:06 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