Closed Thread
Results 1 to 4 of 4

How du Case x twice? (Select Case)

  1. #1
    Registered User
    Join Date
    06-18-2012
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    28

    How du Case x twice? (Select Case)

    Hi,

    i wonder how I can case for ex. x twice? Right not I have the script:

    Function Namex(Ex)

    Select Case Ex
    Case A
    Namex = "Albert"
    Case B
    Namex = "Bernard"
    Case C
    Namex = "Cris"
    Case D
    Namex = "David"
    End Select
    End Function

    For example I want to:
    Case A
    Namex = "Albert" And Namex = "Avery"

    Each Case A = Albert and Avery

    Thnx in advance!

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: How du Case x twice? (Select Case)

    Hi, VBA-NOOB,

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    06-18-2012
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: How du Case x twice? (Select Case)

    Hi,

    i wonder how I can case for ex. x twice? Right not I have the script:

    Please Login or Register  to view this content.
    For example I want to:
    Please Login or Register  to view this content.
    Thnx in advance!

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How du Case x twice? (Select Case)

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Need the proper syntax to use Case/Select Case in vba properly.
    By rbion in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-16-2013, 02:34 PM
  2. [SOLVED] Disregard case in VBA code. (UCase, LCase, Select Case)
    By Orestees in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-07-2012, 12:12 PM
  3. Case Select compile error "Case without case select"
    By coasterman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2012, 06:50 AM
  4. Case without select case error
    By Tano in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-25-2007, 10:27 AM
  5. Select case / case is, multiple arguments
    By Werner Rohrmoser in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2006, 07:00 AM

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