Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynanic Print Range
Having a small problem with setting up a dynamic print range. I have defined
a range by clicking insertnamedefine. Named range is PrintArea and below is the formula: =OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),4) I have also inserted the following vba code into the workbook: Private Sub Workbook_BeforePrint (Cancel As Boolean) With ActiveSheet ..PageSetup.PrintArea = .Range(.Range("A1"), ..Range("PrintArea").Cells(.Range("PrintArea").Cel ls.Count)).Address This setup does exactly what I need with a workbook with only 1 worksheet. However, I need help on adjusting this to work with a workbook with multiple worksheets. Can the dynamic range be defined in vba using ActiveSheet, and if so, what would that look like? I'm looking for something other than a dynamic print range for every worksheet. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
print range won't print | Excel Discussion (Misc queries) | |||
Dynanic Worksheet functions | Excel Worksheet Functions | |||
Print Blank Pgs - Preview margins outside print range | Excel Discussion (Misc queries) | |||
Can you get the range reference for each page in a worksheet print range? | Excel Programming | |||
Excel 2000 VBA - Set Print Range in dynamic range | Excel Programming |