+ Reply to Thread
Results 1 to 2 of 2

Macro for an If statement returning a value if false. Run macro if true.

  1. #1
    Registered User
    Join Date
    09-23-2022
    Location
    Houston, Texas
    MS-Off Ver
    365
    Posts
    64

    Macro for an If statement returning a value if false. Run macro if true.

    I would like to know how I could write a code that would either run or not run based on an IF statement returning a value if false.

    So far, i do have the following.

    Sub SystemCheck()

    Dim SystemCheck As Variant

    SystemCheck = [IF(A1=B1,"","Check System Entered")]


    Here is where I start determining if the rest of my code runs or not but i am not sure how to approach this.

    If SystemCheck = "Check System Entered"

    Then code does not run

    Else

    Code does run

    End if



    End Sub

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Macro for an If statement returning a value if false. Run macro if true.

    Hi Rafael1024-
    Not sure what you're asking, but if that's supposed to be code, the Then keyword must appear on the same line as the If statement:
    Please Login or Register  to view this content.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

+ 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. True and False not returning properly
    By gaby58 in forum Excel General
    Replies: 3
    Last Post: 03-07-2017, 05:11 PM
  2. [SOLVED] Comparing Multiple columns across worksheets and returning a True/False statement
    By RoryK in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-11-2015, 10:33 PM
  3. IF Stmt Returning a TRUE FALSE Value
    By J41 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-27-2014, 08:50 AM
  4. Calling Macro Based then bases result on True False Statement
    By jimrosser in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2013, 04:39 PM
  5. Macro to change name value from true to false
    By dvb_24 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2011, 08:22 AM
  6. Returning True/False/Maybe
    By RivFin in forum Excel General
    Replies: 1
    Last Post: 02-03-2011, 06:29 PM
  7. Formula for returning True (1) or False(0)
    By wish2excel in forum Excel General
    Replies: 5
    Last Post: 10-11-2010, 04:14 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