Hi BARENTINEMATT,
It is probably a good idea to get in the habit of
_1 ) giving the URL link to any site that you use, in this case the Ron de Bruin site You got the code
From
-2) post a full working code, a shortened version if possible. In this case probably the full code you are using would be OK..
_....................
Originally Posted by
BARENTINEMATT
.my question is how can i word the error handling to exit sub and display a msgbox with the filename that failed instead of the current resume next method. ...
That is fairly easy, I tend to put that sort of error handling as standard on most of my codes..
Originally Posted by
Doc.AElstein
.....
_ If the code should end after not opening a file then you modify the code to include an error handling code section, typically towards the end of the code. You then arrange for the code to go there on an Error. There your message would be given just before the code ends.....
_....
_.....
_._____________________________
I am not a Profi myself and prefer to have some test data ( reduced in size where possible ) so I can test and run any code I give. But for this error handler part I think I have done it often enough so I can work “blind” and it should work..
-..
So
here we go
_1 ) Change this bit of the code so that on encountering an Error, although an Exceptional State is still Erected, the code does not stop but is sent somewhere ( in this case to an error handling section towards the end of the code. ( The Error handling section can go anywhere, but as you want to stop shortly after going there it is convenient to put it there) ) :
_...........................
_2) change the end of your code Thus:
_.. I could not test that, but it should do what you want
_...........................
_._________________________-
As for the rest,
Originally Posted by
BARENTINEMATT
....
I may need to post a new thread but additionally i would like to edit it somehow to copy the header of just the first workbook but not rest i initially though it would be pretty simple but i cant seem figure out a good starting piont.....
.. it is probably Ok to post here as it fits the Thread Title, or you could start a new Thread, as you choose..
As before , it is probably very easy to do. It is just a case of explaining carefully exactly what you want. Ideally some test data is needed, as the “Before”, and then some Hand filled in output as the “After”, showing exactly as you want the output to look based on your supplied sample input data.
Alan
P.s.
Some notes here on how to get info across to us
http://www.excelforum.com/hello-intr...ml#post4478582
If you can show clearly what you want in a post in this thread ( the one we are in now ) , and if no one else does it for you I will do it for you tomorrow
Bookmarks