Consulting

Results 1 to 3 of 3

Thread: Running Macro Automatically if a cell value is True.

  1. #1
    VBAX Regular
    Joined
    Feb 2012
    Posts
    46
    Location

    Running Macro Automatically if a cell value is True.

    Hi support,

    Through Schedule Task, daily im opening a macro and running Automatically. But i want a simple validation with if condition before running the macro automatically. If A1 cell value on sheet 2 is True then i want to run the macro. if false i dont want to run the both macro.

    Please help me.

    The below code im using now to run the macro automatically.
    [VBA]Private Sub Workbook_Open()
    Run "ThisWorkbook.Send_Mail"
    Run "Send_Mail"
    End Sub[/VBA]

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [VBA]Private Sub Workbook_Open()
    If Sheet2.Range("A1").Value Then
    Run "ThisWorkbook.Send_Mail"
    Run "Send_Mail"
    End If
    End Sub [/VBA]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Feb 2012
    Posts
    46
    Location

    The above is not working

    In the Validation sheet, If the cell F1 contains "True" then the macro has to run.
    If it is false, then macro should not run. Please help. The file is attached Xld
    Attached Files Attached Files

Posting Permissions

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