• Using a Macro in IF Statements (2002)

    Author
    Topic
    #449810

    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

    Viewing 0 reply threads
    Author
    Replies
    • #1103803

      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.

    Viewing 0 reply threads
    Reply To: Using a Macro in IF Statements (2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: