Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting the Print Area in a macro.
I'm new to VBA and have a problem. Each month I create a cvs file for monthy warranty claims. I open this with Excel. Then I create 13 different reports using Autofilter. Everthing I've done works like a charm except setting the print area. No matter how I arrive at the print range, the macro uses the print area ranges (see next 3 lines) Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select ActiveSheet.PageSetup.PrintArea = "$A$1:$J$55" This works fine for this month but next month all the reports will be different sizes. The fact that the macro defines the "Print Area" makes it useless for the following months. Is there any way to get around this? Thanks in advance *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting the Print Area in a macro.
Dick,
Maybe this is what you are trying to do?... ActiveSheet.PageSetup.PrintArea = Selection.Address Jim Cone San Francisco, USA "Dick Snow" wrote in message ... I'm new to VBA and have a problem. Each month I create a cvs file for monthy warranty claims. I open this with Excel. Then I create 13 different reports using Autofilter. Everthing I've done works like a charm except setting the print area. No matter how I arrive at the print range, the macro uses the print area ranges (see next 3 lines) Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select ActiveSheet.PageSetup.PrintArea = "$A$1:$J$55" This works fine for this month but next month all the reports will be different sizes. The fact that the macro defines the "Print Area" makes it useless for the following months. Is there any way to get around this? Thanks in advance *** Sent via Developersdex http://www.developersdex.com *** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting the Print Area in a macro.
Jim Cone, What a timely and most welcome reply. Your answer corrected my problem. I have 4 books that I'm learning from and none gave me the information I needed. You're greatly appreaciated. Thank you. *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Setting The Print-Area ? | New Users to Excel | |||
Setting print area | Excel Discussion (Misc queries) | |||
setting the print area from a macro | Excel Worksheet Functions | |||
Macro script for setting Print Area | Excel Discussion (Misc queries) | |||
Setting Print Area | Excel Programming |