print property

Is there anyway to put code behind the print button.  

I want the program to auto select ranges and print off that area when the 
print button is pressed without having to go in a set the , print area, page 
setup, fit to one page for four different parts of a worksheet.  Is this 
possible?

Thanks,


0
cwwolfdog (21)
4/9/2005 11:03:02 PM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
662 Views

Similar Articles

[PageSpeed] 37

Right-click the excel LOGO near the File menu, select View Code, on the left 
dropdown select Workbook, in the right dropdown, select Before Print, and 
enter whatever code you want there. The stub is:

Private Sub Workbook_BeforePrint(Cancel As Boolean)

End Sub

Bob Umlas
Excel MVP

"cwwolfdog" <cwwolfdog@discussions.microsoft.com> wrote in message 
news:56BE4985-0958-490A-8F60-8E6FC9D614BB@microsoft.com...
> Is there anyway to put code behind the print button.
>
> I want the program to auto select ranges and print off that area when the
> print button is pressed without having to go in a set the , print area, 
> page
> setup, fit to one page for four different parts of a worksheet.  Is this
> possible?
>
> Thanks,
>
> 


0
4/10/2005 2:15:20 AM
Reply:

Similar Artilces:

printing envelope using current letter pulls in entire letter
I have a letter that was created in 97 and saved as 97-2003. When I try to print my envelope for the letter, the entire letter is pulled in and not just the address. If I create a new letter in 2003, it works fine. How can I use my 97 documents and print my envelopes? To print an attached envelope, put 0 as the page number or use s1 (for section 1) in the Pages box. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "sara b" <sarab@discussions.microsoft.com> wrote in message news:F0DDBD40-2AE1-49DD-B...

Printing all worksheet names
Does anyone know if it possible to print a list of worksheet names? A list similar to the one you would find in the "Contents" tab of the files' Properties. Thanks for any help you can provide. Programme - XP Excel Hi This topic was covered lately in microsoft.excel.worksheet.functions NG (thread 'print sheet tab names' started by JDB at 06.01.2004 16:00). Here is the solution from me: Create an UDF --- Public Function TabByIndex(TabIndex As Integer) As String Application.Volatile TabByIndex = Sheets(TabIndex).Name End Function --- On some empty worksheet,...

print labels
Can Excel print to an Avery label? If so, how do I do this? Thanks, Andre Not really, use mailmerge with Word http://www.mvps.org/dmcritchie/excel/mailmerg.htm -- Regards, Peo Sjoblom http://nwexcelsolutions.com "Andre" <no@spam.com> wrote in message news:OWveirddGHA.3484@TK2MSFTNGP04.phx.gbl... > Can Excel print to an Avery label? If so, how do I do this? > > Thanks, Andre > I have my names in Excel going across fname lname street etc. I then open Word and use mail wizard and follow it and give the excel file as its source Works great ...

Print Preview #4
I would like to preview my worksheets that contains coloured cells as they will print on a BW printer so I know what my charts etc. will actually look like. How do I turn off the Print Preview in colour when printing to a BW printer? i.e. I want to see exactly what will print depending on what printer I go to (the BW or the Colour). Further, I am not asking about the Page Setup option of checkmarking Black and White as that will print in only Black and White and not scale my colours and patterns accordingly to the % they would actually print. Please advise and thank you. Deborah ...

Printing Checks #4
Do I have to buy checks that already have my account and routing number printed to use Money 2003 Standard? Yes. "Tom P" <anonymous@discussions.microsoft.com> wrote in message news:06b601c3aef9$dc7264c0$a301280a@phx.gbl... > Do I have to buy checks that already have my account and > routing number printed to use Money 2003 Standard? ...

Bottom border line won't print in Word 2004 for Mac
Version: 2004 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel On the screen I can place a page border in Word 2004 for Mac document, but in Print Preview the bottom line of the border disappears. And, of course, when I print, the bottom line won't appear. It doesn't appear that any footer (which I don't want) is in the way of the margin that I have set. Any solution to this? See: http://word.mvps.org/faqs/formatting/BottomsDontPrint.htm Also confirm that you have the latest printer driver from the mfr's web site as well as all current updates for Offi...

Worksheet properties
Hello, For some strange reason....all new worksheets that I insert into a workbook seem to right-to-left orientation. So the A column is located on the right hand side and the b column is located to the left of the a column. Does anyone know if this is a setting from the menu or an object that needs resetting in vb? thanks,Matt Matt, Look at Tools - Options - International - Default direction. I think this is only for a new workbook. Doesn't change existing ones. -- Earl Kiosterud mvpearl omitthisword at verizon period net ------------------------------------------- "Matt...

printing a 50:1 scale plan
I'm trying to print a 50:1 scale plan of a large room on a sheet of A3 paper. If A3 is too small I can move up to a plotter if required. What I need to end up with is a physical printout that measures 2cm for every metre. I'm finding the number of different settings confusing - please could someone suggest the correct settings to me? ...

Printing a single form which has tabs
Hello I have created a form in which I am inputting survey data. There are 5 tab pages in this form. I want to print all 5 tabbed pages. I want to create a button called "Print Record". When one clicks on this button, I want it to print all 5 pages. At the moment, I print one page. Then tab to the second page and print, and so. Can I set it so that one you click on print, you can decide on which page you want to print or print all five pages? Can I do this in code? If this isn't the right section, please direct me. Thank you in advance. Generally spea...

Quest
does csvde has limitied attributes to export ? For quest cmdlets, i can use more properties/attributes, but i wish to pipe to csvde for export. Can it be done ? Why not just pipe to a csv file -- Richard Siddaway All scripts are supplied "as is" and with no warranty PowerShell MVP Blog and PowerShell User Group: http://msmvps.com/blogs/RichardSiddaway/Default.aspx "IT Staff" wrote: > does csvde has limitied attributes to export ? > > For quest cmdlets, i can use more properties/attributes, but i wish to pipe > to csvde for e...

Where is print preview in Word 2010
I'm lost - where under print do I find print preview? cb4134 wrote: > I'm lost - where under print do I find print preview? Click the File tab and click Print, or just press Ctrl+P. The entire right side of the screen shows the print preview. In fact, unless you put the Quick Print button on the Quick Access Toolbar and use that, you can't avoid the print preview. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. Jay seems to be re...

Text and backgound do not print
I have created a folding leaflet which appears fine on the screen. However, when I click on print preview, half of the leaflet appears only as a white space. When I print it, I get the same result, i.e. only half of it appears on the page. Can anyone help, please? Try running Design Checker on your leaflet. Sometimes issues will show up that that prevent items from being printed. I just helped a woman with a very similar issue. I deleted some extra text boxes and it's fine. ;-) -- JoAnn Paules MVP Microsoft [Publisher] ~~~~~ How to ask a question http://support.microsoft.com/...

Printing landscape worksheets with footer on left
I know that I must not be the first person to have this problem, but I cannot find a solution. I have a workbook that has 20 worksheets. The orientation varies between portrait and landscape. I need the landscape worksheets to print with the footer on the "left" side, so that when I put the entire report (workbook) together for presentation, all of the footers are on the bottom, like a book. I have tried merging the first column (A) and making it the footer with the font facing left, but it is difficult to make them print evenly on each sheet. I have also tried to cop...

Print bcc's on copy of sent message?
If *I* send a message and blind copy someone on it, is there any way to get Outlook to print the bcc recipients? Right now I'm having to handwrite the bcc's on my file copy. Would love it if Outlook would automatically print this. ...

Print to a file
My program has some methods that print to a printer OK. But I need to put labels on those files afterwards so it would be better to print them to a file first. The program calls GetPrinterDC() before starting the printing. Is there some update that will permit the user to print to a file? Thanks, E-Jo Hello E-Jo, Glad to see you. Generally speaking, if you want to save and add the information in current dc to a file, you can create a dc from a bmp and blt all informaiton from the src dc to the bmp. I notice you would like to put labels on a file after it is printed. I am afraid I...

Access 2000:Print settings keep changing
I have created reports and saved the margins and column settings. But, I always get a call from co-workers stating these settings are messed up. These settings will be great for a number of days, and then they get changed. I have often wondered if one of the users is doing an "oops" and resetting those certain reports back to default, or is there a bug that might be causing this? This is a small office and I really don't think this is a malicious event. On Tue, 8 May 2007 20:44:01 -0700, ctuck61 wrote: > I have created reports and saved the margins and column setti...

Epson Stylus NX515 does not print, not even a Test page
I use Windows 7 and the Epson Stylus NX515 is on and the wireless light is also on. But it does not print. The documents are in the queue but do not print. Not even a test page. Here is a link to Epson trouble shooting site. Make sure when you want to print you pick your printer if there is a list of printers. "Ritter197" wrote: > I use Windows 7 and the Epson Stylus NX515 is on and the wireless light is > also on. But it does not print. The documents are in the queue but do not > print. Not even a test page. > > . > http://www.epson.com...

Print Button
On my summary tab, I want to add a print button command that will print the entire work book if the button is pushed. How do I add the print button? Hi, First do the print setup for all the tabs then write a macro to print each tab create a button in summary sheet using toolbox assign the macro to this button Ratheesh ...

Opening address book in Word to print labels & envelopes
When I try to open the address book in Word to print labels, I get a notice to log onto Microsoft Exchange. I do not understand what to do??? Post your Outlook version. Post the mail accounts you have configured for Outlook. State whether you have added the Outlook Address Book to your Outlook Profile. -- Russ Valentine [MVP-Outlook] "Dolores" <fischere@midwestis.net> wrote in message news:25BF4DED-58CC-49B5-8DD0-2D8482BE6BC2@microsoft.com... > When I try to open the address book in Word to print labels, I get a notice to log onto Microsoft Exchange. I do not understand...

How to see ... Property, Details in a message
Greetings from Italy, I need to know IP of some messages I receive with Outlook (not Outlook Express) When I used Outlook Espress this was very easy: File, Properties, Details, Original message Using Outlook (2002) this seem to me impossible: How can I do ?Thank you Loplop Loplop wrote: > I need to know IP of some messages I receive with Outlook Right-click on the message, Options. Or open the message in its own window and use View -> Options. Or get the PocketKnife Peek add-on (free). > When I used Outlook Espress this was very easy: File, Properties, > Details, Or...

Can you print specific worksheets?
Hi everyone, I have 15 worksheets in my workbook, but i just want to print specific worksheets. Is it possible to specify which worksheets you want to print to save me having to print the whole workbook? Many thanks, Rodney You can print each sheet individually (15 separate print) or Select the sheets (click on the first sheet and ctrl-click on the subsequent sheets) then File|Print Rodney wrote: > > Hi everyone, > > I have 15 worksheets in my workbook, but i just want to print specific > worksheets. Is it possible to specify which worksheets you want to print to > ...

Excel 2002 Column Widths & Printing
Excel column widths are starting to confuse me! I have a workbook containing several sheets. The sheets are not identical and have differing numbers of columns, e.g. some sheets have 9 columns, whilst others have 11 or 14. The margins for each sheet are exactly the same with 0 set for header and footer. The printer setup for each page calls for 100% normal size, A4, 1 page wide by 1 page tall. The correct print area is set for each sheet. The various column widths for each sheet, when added together, are identical (86 units in this case, although what the 'units' are, I do n...

How do you print one address label at a time on avery 5160 labels.
I'll bet you have partial sheets of labels. I know that's why I have to use a work-around. You'll have to use a template of the entire sheet, not the wizard. 1. Go to http://publishermvps.com/Default.aspx?tabid=38 2. Download the template for Avery 5160 labels. 3. Create the label you want. 4. Print said label. 5. Thank Brian for saving you A LOT of time and work. (I've been known to lay my label out in Publisher and then copy and paste it into a Word document.) -- JoAnn Paules MVP Microsoft [Publisher] "sharonm" <sharonm@discussions.microsoft.com&...

Userform
Hi all I have a problem I am using the following code, Private Sub cmdPrint_Click() frmOrders.PrintForm End Sub How is it possible to get the userform to be printed in landscape Thanks in advance Greg Greg, You could throw up a print dialog and allow the user to select landscape (and even the printer if required), and then print after, something like Private Sub cmdPrint_Click() Dim fOK As Boolean Dim sPrinter As String With Application sPrinter = .ActivePrinter fOK= .Dialogs(xlDialogPrinterSetup).Show End With If fOK= Then frmOrders.PrintForm...

Printing certian events
How do I print a calendar with only certian events instead of a calendar with all events and appointments. For example if I want to print a calendar with only Business events? You could Filter the view first, or use Find, depending on what kind of calendar and time frame you were printing. Matt Lujano wrote: > How do I print a calendar with only certian events instead of a calendar with > all events and appointments. For example if I want to print a calendar with > only Business events? Create a filter that shows only items in the Business category. -- Dia...