+ Reply to Thread
Results 1 to 3 of 3

is if-then or select case statement with multiple arguments possible?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    107

    is if-then or select case statement with multiple arguments possible?

    the macro needs to check cells(1,1) and cells(1,2) if they are empty, i thought a code like this would be possible:

    sub checkifblank ()
    If Sheets("mcr analysis").Cells(1, 1).Value And Sheets("mcr analysis").Cells(1, 2).Value = 0 Then
        MsgBox "this is NOT working"
    End If
    How do i make excel check the two cells in one if-then statement? or do i have to do multiple if-thens per cell?

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: is if-then or select case statement with multiple arguments possible?

    hi kjy1989. you were close:
    If Sheets("mcr analysis").Cells(1, 1).Value = 0 And Sheets("mcr analysis").Cells(1, 2).Value = 0 Then

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Contributor
    Join Date
    12-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    107

    Re: is if-then or select case statement with multiple arguments possible?

    I see, thank you benishiryo! I was close lol.

+ 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. Replies: 4
    Last Post: 05-06-2013, 11:06 AM
  2. 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
  3. [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
  4. Select Case Statement Help
    By Jeugo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2006, 03:45 PM
  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

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