+ Reply to Thread
Results 1 to 7 of 7

Case Statement with Multiple Conditions

Hybrid View

  1. #1
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Case Statement with Multiple Conditions

    In that case
    Sub test()
        Dim x As Worksheet, y As Worksheet
        On Error Resume Next
        Set x = Sheets("sheet1")
        Set y = Sheets("sheet2")
        On Error GoTo 0
        Select Case True
            Case x Is Nothing And y Is Nothing
                ' do 1
            Case Not x Is Nothing And Not y Is Nothing
                ' do 2
            Case Not x Is Nothing
                ' do 3
            Case Not y Is Nothing
                ' do 4
        End Select
    End Sub

  2. #2
    Registered User
    Join Date
    08-10-2012
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Case Statement with Multiple Conditions

    That did the trick jindon, many thanks!

+ 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] 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
  2. Using Case Select On Range With Multiple Conditions?
    By alulla in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 07-03-2013, 02:50 PM
  3. Replies: 4
    Last Post: 05-06-2013, 11:06 AM
  4. 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
  5. [SOLVED] Case Statement using a Range of Conditions
    By Andrew Bird via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-28-2005, 12:06 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