+ Reply to Thread
Results 1 to 2 of 2

If statement result runs a MACRO

Hybrid View

  1. #1
    Registered User
    Join Date
    09-02-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    1

    If statement result runs a MACRO

    I have various MACROS in this worksheet and need to run specific MACROS based on the result of an 'IF' statement result. Can this be done? Basically, if YES then do this, If NO then do that.

    Thank you

  2. #2
    Registered User
    Join Date
    01-28-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003, Excel 2007, Excel 2010
    Posts
    50

    Re: If statement result runs a MACRO

    You can add a macro to the worksheet itself and use it to check if a particular cell matches what you want to run your macros.

    ie if you are wishing to check cell a1
    Private Sub Worksheet_Change(ByVal Target As Range)
    if range("A1").value = x then
        {macro_1}
    end if
    End Sub
    Please consider the * button if my post helped you

+ 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: 0
    Last Post: 08-16-2012, 01:32 PM
  2. [SOLVED] Complicated IF statement that runs an equation on True
    By scrumpulate in forum Excel General
    Replies: 1
    Last Post: 04-20-2012, 04:24 PM
  3. Replies: 3
    Last Post: 12-15-2009, 10:22 AM
  4. If then statement to control when the script runs
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-29-2009, 06:42 PM
  5. macro to run as result of if statement
    By martindwilson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2008, 06:08 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