Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assume there is a blank cell in column A within your data?
ActiveSheet.PageSetup.PrintArea = "=OFFSET(A1,,,COUNTA(A:A)+1,11)" Other than that set rng = Range(cells(1,1),cells(rows.count,1).End(xlup)) ActiveSheet.PageSetup.PrintArea = rng.Resize(,11).Address(external:=True) you would need to rerun the macro each time the range changed. -- Regards, Tom Ogilvy "Christy" wrote in message ... Hi all, I have following code to set the printarea for a worksheet. It works but falls one row short of getting the used data. How can I adjust to fix that? In case I have not said it lately, what a GREAT site this is and thanks to all of you who help our struggling! Christy ;) If ActiveSheet.Name = "LogReport" Then ActiveSheet.PageSetup.PrintArea = "=OFFSET(A1,,,COUNTA (A:A),11)" 'gets active data through column 11 With ActiveSheet.PageSetup .Orientation = xlLandscape .PaperSize = xlPaperLetter .Zoom = 100 End With ActiveWindow.SelectedSheets.PrintPreview End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
set area in excel not giving me option to set print area? | Excel Discussion (Misc queries) | |||
File, print area, clear area, is not working | New Users to Excel | |||
print area across the freeze panes area | Excel Worksheet Functions | |||
Pivot Table macro to set print area and print details of drill down data | Excel Discussion (Misc queries) | |||
How do you turn off a print area for a page? (no print area) | Excel Discussion (Misc queries) |