View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Kevryl Kevryl is offline
external usenet poster
 
Posts: 89
Default How to end/up end/across to select print area?

Sorry, I should have mentioned I'm using Excel 2000 v.9

"Kevryl" wrote:

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