LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 89
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set print area for the entire excel workbook milesel Excel Discussion (Misc queries) 1 May 5th 06 12:11 AM
Formula to govern Print Area kwrohde Excel Discussion (Misc queries) 2 April 27th 06 01:24 PM
Pivot Table macro to set print area and print details of drill down data Steve Haskins Excel Discussion (Misc queries) 2 December 28th 05 04:59 PM
Extra Row in Defined Print Area Harry Gordon Excel Discussion (Misc queries) 3 November 14th 05 03:06 AM
Changing print area Aaron Excel Discussion (Misc queries) 2 January 9th 05 05:58 PM


All times are GMT +1. The time now is 05:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"