PDA

View Full Version : Adjusting Page Layout for printing



nathan2314
11-19-2010, 11:51 AM
Hi,
I've written quite a bit of VBA code but never had to deal with page layout for printing so I'm not sure how to do this. Basically, I have written some lengthy VBA code to read in a bunch of Excel files all with the same format on several sheets. They are all read and formated the way I want and consolidated into one Excel file. The way the output sheets are set up is that they have the first three colums with standard information that doesn't change .. ie Questions / Measures / notes. The following columns are the response inputs from all the other Excel files (Each response takes up two columns .. Response / Comments). So I have the freeze panes set for the first three columns so a person can see the questions / comment / notes as the scroll through and see all the inputs.

So now what I need to do is somehow in VBA adjust the page layout so that the first three standard columns are on every page and then each response (which is always two columns) is outputted next to the standard three columns.

So for example, if columns A-C are standard and the first responses are in columns D and E, for the first sheet I would want columns A-E outputed all on one page. Then the next page would be columns A-C and columns F and G. The next page would be columns A-C and then columns H and I etc etc. Each sheet would be one page.

How can I do something like this?? All the column lenghts are the same for each input sheet.

Appreciate any help!! :)