• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro to check row data and call another macro

IKHAN

Member
Summary : I am pulling data from a third party application from excel 2010, runs every 30 mins and then calls outlook email macro to send me email.(using Ron de Bruin Code Outlook object model (body) )


problem:Mail is being sent out even if no data in row 10 onwards.


Need help with macro to check excel spreadsheet if no data is available in Specific ROW10 ,R11 , R12 ,R13,R14,R15....UPTO R20 , not to call outlook email macro.


Have a header file in ROW in excel in Row9(A9:L9)


Macro 1 (automatic runs every 30 mins)- pulls data from third party application into excel 2010,calls

Macro 2 - Ron de Bruin Code Outlook object model (body) ) and sends email out.
 
Ikhan


You could do something like:

[pre]
Code:
myRange = Range("A10:XFD20")
If Application.WorksheetFunction.Sum(myRange) <> 0 Then Call Macro2
[/pre]
 
Thanks for prompt reply ...I did add your code at the end of macro1 before end sub..get a error msg..myrange variable not defined.
 
Tweaking Hui's code:

[pre]
Code:
Dim myRange as Range
Set myRange = Range("A10:XFD20")
If Application.WorksheetFunction.Sum(myRange) <> 0 Then Call Macro2
[/pre]
 
Thanx Luke


I had removed the Option Explicit line for another project and missed that
 
Back
Top