Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Jul 8, 4:01 pm, Susan wrote:
Help, we are constantly adding new data and trying to write a macro (which I am new to) that will set the print area automatically to the last row with data in it. Can someone please help me.... I have no idea what i am doing and the people i am writing this for have less knowledge. Any help would be appreciated! try the following macro strip, Of course you will have to determine where the end of the data is located (i call it lastpos) ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), Cells(lastpos, 15)).Address printsetup Application.ScreenUpdating = True Function printsetup() With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "&D" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0.5) .RightMargin = Application.InchesToPoints(0.5) .TopMargin = Application.InchesToPoints(0.5) .BottomMargin = Application.InchesToPoints(0.5) .HeaderMargin = Application.InchesToPoints(0.5) .FooterMargin = Application.InchesToPoints(0.5) .PrintHeadings = False .PrintGridlines = True .PrintComments = xlPrintNoComments .PrintQuality = 300 .CenterHorizontally = True .CenterVertically = False .Orientation = xlLandscape .Draft = False .PaperSize = xlPaperLetter .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 .PrintErrors = xlPrintErrorsDisplayed End With End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Print area giving me 1 page per cell | Excel Discussion (Misc queries) | |||
Sorting data to a 'print' area ?? | Excel Discussion (Misc queries) | |||
Pivot Table macro to set print area and print details of drill down data | Excel Discussion (Misc queries) | |||
Active cell counting in particular print page (one sheet having different print area) | Excel Worksheet Functions | |||
How do you turn off a print area for a page? (no print area) | Excel Discussion (Misc queries) |