I am using a invoicing program that uses Excel..and there is a portion of the Invoice that I only want to print once and then not print the next time that document is printed.
Is there a way to do this?
Change the print area?
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Is there a way to automate that with scripts though? As we print invoices over and over all day and it would be a big pain to have to manually change print area every time?
Im new to excel so I don't know how to do much![]()
Sure, it can be automated, given sufficient information to understand what you want.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
I'm using the invoice program/template on office-kit.com.
On it is an invoice that print and you can go back and edit them in a database.
On the bottom of the invoice I have put a little section that I want to print the firsttime I print the invoice but any time after I need to have those rows not print anymore. its basically the last 5-10 rows on the bottom of the page.
Post a workbook and explain in context.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Not sure if the attachment will work without the database functions but I attached it.
On here if you look at the bottom you will see a claim stub. When a customer first comes in we only partially fill out this page with their info. We print this form and give them the claim stub (cut off the bottom). When they come back in to claim their repair we reopen their invoice and fill it out and reprint it...I don't want the claim stub portion to print the second time it prints.
So I need a function to turn off that area for printing and back on..or a feature that would automatically turn it off based off a cells value maybe? (Like I could have a cell that is marked True or False and once I print it I can mark it True which will make it not print the next time)
I could probably figure this out but I do not know scripting that well nor do I know about changing printable areas.
Thanks for your help.
Someone is planning to add a ton of code to this -- who?
Define two names on the sheet: Insert > Name > Define,
Invoice!rgnInitial Refers to =$E$3:$O$52
Invoice!rgnFinal Refers to =$E$3:$O$51
You have a Print button on the invoice tab. Add another, and name one btnPrintInitial and the second btnPrintFinal
Then in the Sheet module,
Code:Private Sub btnPrintInitial_Click() Me.PageSetup.PrintArea = Range("rgnInitial").Address Me.PrintOut End Sub Private Sub btnPrintFinal_Click() Me.PageSetup.PrintArea = Range("rgnFinal").Address Me.PrintOut End Sub
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
I got it working, thank you so much.
I need to remove the entire bottom though from the dotted line down, instead of just the CLAIM CHECK line, but I THINK I can figure that part out.
Last edited by NewYears1978; 03-16-2010 at 08:19 PM.
Adding Code to a Sheet module
1. Copy the code from the post
2. Right-click on the tab for the relevant sheet and select View Code. This opens the Visual Basic Editor (VBE) and shows the object module for the selected worksheet.
3. Paste the code in the window
4. Press Alt+Q to close the VBE and return to Excel
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
I actually had figured it all out before your last post, but I came back to say thank you very much.
Will definately be coming around here often.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks