ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Macro to print filtered results (https://www.excelbanter.com/excel-worksheet-functions/266111-macro-print-filtered-results.html)

JBRTaylor

Macro to print filtered results
 
Hi

I am trying to print print a list of invoices for clients which changes each month. I would like to create a macro to speed up the process.

Without using a Macro i would follow the following steps:
Select cell on the invoice worksheet
select the first client on the client 'autofilter' list
select a cell on the invoice (so correct area is printed)
Go to file print, select printer, print pages 1 - 1, then press print.
repeat for next client.

So far i have the following VBA intructions but it is not working correctly because:
1 i am using the 'criteria' or name listed in the menu which is not working because it keeps changing from month to month
2 and i don't know how to get it to repeate for the next item on the autofiltered list

Sub printinvoice()
'
' printinvoice Macro
' Macro recorded 29/09/2010 by Jon Taylor
'
'
Range("M2").Select
Selection.AutoFilter Field:=1, Criteria1:="Client1"
Range("M2").Select
Application.ActivePrinter = "PDFCreator on Ne01:"
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True
End Sub


Any help with this would be greatly appreciated.

Thanks
Jon


All times are GMT +1. The time now is 03:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com