No offense, but if you are giving advice that includes a macro that will delete data, and the user has only said they don't want it
printed, the LEAST you can do is warn them that this option will delete the data if they run the macro. Good thing they only have to
close without saving to get their data back if they were smart and saved before putting your macro in their file.
--
RMC,CPA
I'm sorry......the macro does "clear contents" on the selected range, thereby
"preventing that area from being printed out". Since you had not specified
what particular data you wished prevented from printout, I only offered it as
a example method of what could be done. It never occured to me that you
would want the user to be able to continue working with the sheet after
trying and failing to print out. The data cannot be restored in this
session. If you did not save the file back over the original, then just
re-opening the original will retrieve the data. If you wish a similar
action, but the data to be retrieveable, then the macro could be modified to
just copy the data to another sector and then later be restored back.....or
a completely different tact taken. Give us some more details on exactly what
you wish to have happen when a user tries to print out, and someone will help.
Vaya con Dios,
Chuck, CABGx3