Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Mar 2002
    Location
    Ventura, California, USA
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using a Macro in IF Statements (2002)

    Hey Gang,

    I need to set up a page that adds worksheets to the workbook based on a drop list choice. I have the Add worksheet in a macro and runs fine I need it to run from an IF/Then statement...i.e if(A4="Yes", Run macro X, Run macro Y)

    Anyt help would be appreciated.

    Dan

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Using a Macro in IF Statements (2002)

    The code would look like this:

    If Range("A4") = "Yes" Then
    Call MacroX
    Else
    Call MacroY
    End If

    Not: you cannot add a worksheet by calling code from a cell formula.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •