*Go to the Visual Basic Editor (from Excel, go Tools/Macro/Visual Basic
Editor)
*In the VB Editor, make sure the Project Explorer window is visible
(View/Project Explorer - there's also a button up in the toolbar for this,
which you will find easily enough if you nose around for it)
*In the Project Explorer, expand the "tree" for the VBA project that you
want to work on - it will have the name of the relevant Excel file in brackets
*DoubleClick on the "This Workbook" object within that tree
* There will be 2 dropdown boxes up near the top of the screen. Make sure
the left hand one says "Workbook" rather than "General"
* Scroll around in the right hand dropdown for "BeforePrint". When you
select it, the editor will place the"shell" of a Sub in the code window for
you. Whack your code in there and off you go. Note that the Sub comes
pre-loaded with the parameter "Cancel as Boolean" - If you go "Cancel =
True", the Print will not go ahead. Obviously you can play around with that
and make it conditional, as I described before.
* Hope this is all OK in XL97 !!!!!!
It's worthwhile having a good look at all of the other events that you can
harness in a Workbook and on individual Sheets. These are things that can
help turn little macro-driven Excel files into real interactive
mini-applications suitable for users who don't have much IT savvy (welcome to
my world ...)
PS: My name is not really Neptune, but time really is just the thing that
keeps everything from happening all at once