I am trying to setup a macro that formats my invoices sheets. The macro that I recorded is running okay but the print range is too large for the invoice and I don't want it set at one print range. I want excel to find the last row and column of data per set print range. In this case I have one invoice but problaly need two print ranges or ranges with variables setup to read last row of data from rows A1 to K1 End.xldown. The invoice row range varies from A1 to A150 but I want the print range to fit exactly the same size as my invoice. Here is what I have recorded please help me finx this. Thanks RG,
Range("B7").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.End(xlDown).Select
ActiveWindow.SmallScroll Down:=18
ActiveWindow.SmallScroll Down:=5
ActiveSheet.PageSetup.PrintArea = "A1:K100"
Range("B65536").End(xlUp).Select
ActiveWindow.View = xlPageBreakPreview
ActiveSheet.PageSetup.PrintArea = "A1:K100"
ActiveWindow.SmallScroll Down:=-55
End Sub
Range("B7").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.End(xlDown).Select
ActiveWindow.SmallScroll Down:=18
ActiveWindow.SmallScroll Down:=5
ActiveSheet.PageSetup.PrintArea = "A1:K100"
Range("B65536").End(xlUp).Select
ActiveWindow.View = xlPageBreakPreview
ActiveSheet.PageSetup.PrintArea = "A1:K100"
ActiveWindow.SmallScroll Down:=-55
End Sub