LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Macro Code Help

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slow code when used as VBA code instead of macro (copying visible columns) [email protected] Excel Programming 3 April 2nd 07 05:26 PM
Can I use code/macro to change code/macro in an existing file? Scott Bedows Excel Programming 2 February 14th 07 05:50 AM
Macro code to remove a macro after it executes Charles Excel Programming 4 March 22nd 06 12:11 PM
read macro code by vb code Francesco Geri Excel Programming 2 October 7th 05 10:24 AM
do anybody have a sample code for executing excel macro from vb code?<eom B Deepak Excel Programming 2 September 30th 05 09:59 AM


All times are GMT +1. The time now is 03:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"