Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to end/up end/across to select print area?
This should be easy, but it won't work.
I have a cash analysis spreadsheet that expands downwards as it goes, and I simply want to print the latest month off in a macro that closes the month and does all sorts of other complex stuff perfectly. I have created a "rail" on the right hand edge with a "|" character to end/up to a break in that column. With macro set to "relative" I record shift/end/up from an named anchor point to select the vertical area, then try to record shift/left left left etc to select all the columns (as not all cells contain data). I print and naturally it prints perfectly, but when I run the macro it goes haywire, printing way up beyond the area selected. This is how that section of the recorded macro looks: Application.Goto Reference:="Total" (bottome edge of sheet, left hand side) Selection.End(xlUp).Select (goes to last entry) ActiveCell.Offset(0, 61).Range("A1").Select (goes to final column containing the 'rail') Selection.ClearContents (creates a break in the rail for next month) Range(Selection, Selection.End(xlUp)).Select Range(Selection, Selection.End(xlUp)).Select (selects column up to break in rail at last month) ActiveCell.Offset(-120, -61).Range("A1:BJ121").Select (attempting to make the selection 3 dimensional to include all columns) ActiveCell.Activate Selection.PrintOut Copies:=1, Collate:=True (Bombs out, printing to about a month an a half further back than my topmost selection!) Can anyone tell me where I'm goimg wrong, or offer a solution? Thanks, Keith |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to set print area for the entire excel workbook | Excel Discussion (Misc queries) | |||
Formula to govern Print Area | Excel Discussion (Misc queries) | |||
Pivot Table macro to set print area and print details of drill down data | Excel Discussion (Misc queries) | |||
Extra Row in Defined Print Area | Excel Discussion (Misc queries) | |||
Changing print area | Excel Discussion (Misc queries) |