2、按alt+F11打开VBA工程界面,在工程界面新建模块,然后在代码区域输入下面的代码:
Sub 批量筛选打印() Range("G1").Activate ActiveCell.CurrentRegion.Select Dim i As Integer i = Selection.Rows.Count Range("A1:C1").Select Selection.AutoFilter For Each c In Range("G1:G" & i) Selection.AutoFilter field:=1, Criterial:=c.Value ActiveSheet.PrintOut Application.Wait (Now + TimeValue("00:00:01")) Next End Sub保存后,按F5运行,注意在这之前要先把打印机设置好。用excel实现批量筛选打印,有多种方法,这里介绍了一种用vba代码实现的方法,自由度比较高