PDA

View Full Version : Running Macro Automatically if a cell value is True.



sethu29
02-28-2013, 01:26 AM
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.
Private Sub Workbook_Open()
Run "ThisWorkbook.Send_Mail"
Run "Send_Mail"
End Sub

xld
02-28-2013, 03:11 AM
Private Sub Workbook_Open()
If Sheet2.Range("A1").Value Then
Run "ThisWorkbook.Send_Mail"
Run "Send_Mail"
End If
End Sub

sethu29
02-28-2013, 05:53 AM
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