+ Reply to Thread
Results 1 to 6 of 6

Multiple Instruction within a Case statement

  1. #1
    Registered User
    Join Date
    06-14-2016
    Location
    Berlin
    MS-Off Ver
    2013
    Posts
    6

    Multiple Instruction within a Case statement

    How can I realize two or more instructions in a case statement?

    For example:
    Select case
    Case1: Instruction 1; Instruction 2; Instruction 3
    Case2: Instruction 4; Instruction 5
    Case else: Something else
    End select

  2. #2
    Registered User
    Join Date
    01-05-2017
    Location
    carrer rockledge
    MS-Off Ver
    2013
    Posts
    5

    Re: Multiple Instruction within a Case statement

    Using And Function after Select case

  3. #3
    Registered User
    Join Date
    06-14-2016
    Location
    Berlin
    MS-Off Ver
    2013
    Posts
    6

    Re: Multiple Instruction within a Case statement

    I may not understand this correctly but do you refer to Conditions for the "select case"?

    Or do you mean "case 1: MsgBox("Text") AND variable1= 17 AND DoSomethingElse" ?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Multiple Instruction within a Case statement

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    06-14-2016
    Location
    Berlin
    MS-Off Ver
    2013
    Posts
    6

    Re: Multiple Instruction within a Case statement

    Thank you

    I had to edit this post:

    I did it exactly as you said, that means "just make a new line for every instruction within the CASE statement"

    No ":" necessary, no "&" or "AND" necessary

    I did not know it would be THAT EASY. Thanks again @shg
    Last edited by ydrive; 01-06-2017 at 02:52 PM.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Multiple Instruction within a Case statement

    You're 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] i have an if then statement that works, how to make it work as a with or case statement
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-03-2016, 03:34 PM
  2. [SOLVED] Case Statement with Multiple Conditions
    By ezrizer in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-12-2014, 09:13 AM
  3. [SOLVED] is if-then or select case statement with multiple arguments possible?
    By kjy1989 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 02:54 AM
  4. Replies: 4
    Last Post: 05-06-2013, 11:06 AM
  5. Select case instead of if statement formula in multiple cells (macro)
    By city in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2012, 07:56 AM
  6. [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
  7. 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