T
tennisash
I have this set of code in a macro that I am using to gather our
salespeople's customer information. This works great until I get to
some of our newer salespeople that don't have any customers yet. It
changes every month how many and if a salesperson has any customers.
What I need for it to do is to run the application and if their name
isn't found go on to the next line of code. Is there a way that I can
do this? So far it just brings me an error message and then I'm stuck
and have to run all the rest manually. Can I put in some extra code or
something to suppress the error message and keep on running? The code
that I am currently using is below. Keep in mind we have over 100
employess so this is cumbersome doing it manually.
Sheets("W Zone").Select
Range("I228").Select
ActiveCell.FormulaR1C1 = "aaaa"
Range("I228").Select
Application.Run "'Branch Productivity Report.xls'!
GetCustomerRecord"
Sheets("NE Zone").Select
Range("I81").Select
ActiveCell.FormulaR1C1 = "bbbb"
Range("I81").Select
Application.Run "'Branch Productivity Report.xls'!
GetCustomerRecord"
Range("I130").Select
ActiveCell.FormulaR1C1 = "cccc"
Application.Run "'Branch Productivity Report.xls'!
GetCustomerRecord"
ActiveWorkbook.Save
Thank you in advance for any ideas that you have
salespeople's customer information. This works great until I get to
some of our newer salespeople that don't have any customers yet. It
changes every month how many and if a salesperson has any customers.
What I need for it to do is to run the application and if their name
isn't found go on to the next line of code. Is there a way that I can
do this? So far it just brings me an error message and then I'm stuck
and have to run all the rest manually. Can I put in some extra code or
something to suppress the error message and keep on running? The code
that I am currently using is below. Keep in mind we have over 100
employess so this is cumbersome doing it manually.
Sheets("W Zone").Select
Range("I228").Select
ActiveCell.FormulaR1C1 = "aaaa"
Range("I228").Select
Application.Run "'Branch Productivity Report.xls'!
GetCustomerRecord"
Sheets("NE Zone").Select
Range("I81").Select
ActiveCell.FormulaR1C1 = "bbbb"
Range("I81").Select
Application.Run "'Branch Productivity Report.xls'!
GetCustomerRecord"
Range("I130").Select
ActiveCell.FormulaR1C1 = "cccc"
Application.Run "'Branch Productivity Report.xls'!
GetCustomerRecord"
ActiveWorkbook.Save
Thank you in advance for any ideas that you have