Question:
Calling all excel wizards!!!?
luke_thomasuk
2010-05-21 07:52:58 UTC
Hi,

I've put together a spreadsheet that has numerous sets of data on it. What i'm looking to do is add a button or some other appropriate function that will allow me to print a certain section of the spreadsheet.

I know I can highlight the area and set the print area but was wondering if there was another way this could be done automatically at the click of a button. What this will effectively do for me is print a report of a particular data set included in the spreadsheet.

I'm sure this is possible. Will macros be involved?

Thanks in advance for any help.
Four answers:
Auraomega
2010-05-21 07:55:34 UTC
I'd personally make an access database which links to the spreadsheet and then set up forms to do all of the above, it's quicker, looks more professional and easier to edit/manage in the future.
devilishblueyes
2010-05-21 15:43:32 UTC
Yes, you'll want to use a macro. You can add a command button to your worksheet. Then right click the button and select view code. Between the two lines of code that have "Sub" in them you'll want to add some code like this:



Worksheets("Sheet1"). _

PageSetup.PrintArea = Range("John").Address



First, I would recommend naming the range you want to print. To do that, select the range then go to the name box above cell A1 and type in the name. The name cannot have any spaces in it. Then press Enter. For the name of the range in my example I used the name John. And in this example John is on Sheet1. Keep in mind that the named range should be one continuous block of cells. Then just repeat the steps and create a button for each set of data. Or you could do it also with one single combobox where you add the names for all of those ranges to the combobox's list and when that range is selected from the list it will print out just that range. But that's a tad more complicated since you first have to populate the combobox.



And yes, you can send me a message through on here. My profile is emailable. But I'm not going to give out my email address in an answer for the whole world to see. If you have Excel 2007 you can create Custom Views then print them out, but that can't necessarily be done right at the click of a button.
IXL@XL
2010-05-21 15:56:22 UTC
You could make a number of specialised views and print those instead.
Motörhead Fan
2010-05-21 14:55:13 UTC
sorry, I had to laugh when I first saw the question. I thought it said "Calling all EVIL Wizards"


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...