JohnZ1156
Board Regular
- Joined
- Apr 10, 2021
- Messages
- 180
- Office Version
- 2021
- Platform
- Windows
Runing MS Excel 2021.
I have an Excel table. I have a macro that will print out the last 45 rows of the table.
I would like to be able to print out the last 45 visible rows of a "filtered" table.
Now, it only prints out the visible rows within the last 45 rows.
I have an Excel table. I have a macro that will print out the last 45 rows of the table.
I would like to be able to print out the last 45 visible rows of a "filtered" table.
Now, it only prints out the visible rows within the last 45 rows.
VBA Code:
Sub RegisterPrint()
' Call ShowAllPrinters
Application.ScreenUpdating = False
Application.ActivePrinter = "HP Officejet Pro 8600 (Network) on NE02:"
Application.Dialogs(xlDialogPrinterSetup).Show
ActiveSheet.PageSetup.PrintArea = ""
Dim MyLastRow As String
MyLastRow = Range("A65536").End(xlUp).Row
Range("A" & (MyLastRow - 44) & ":K" & MyLastRow).Select
'Put paste code down here
ActiveSheet.PageSetup.PrintArea = Selection.Address
' Application.Dialogs(xlDialogPrinterSetup).Show
'Worksheets("Sheet1").Activate
'ActiveSheet.PageSetup.PrintArea = _
'ActiveCell.CurrentRegion.Address
, Call RegisterHeader
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Preview:=True, Collate:=True, _
IgnorePrintAreas:=False
' ActiveSheet.PageSetup.PrintArea = ""
Range("B1048576").End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Call Change_Font
'-------------------------------------
Range("A1048576").End(xlUp).Select
ActiveCell.Offset(-16, 0).Select
Application.Goto ActiveCell, Scroll:=True
ActiveCell.End(xlDown).Select
ActiveCell.Offset(1, 1).Select
Application.ActivePrinter = "HP Officejet Pro 8600 (Network) on NE02:"
Application.ScreenUpdating = True
End Sub