2016-09-22 136 views

回答

0

下次尝试并做一些挖掘工作,因为这对您来说确实很容易编写和实践。您只需要查找范围中的最后一行并将打印区域设置为A1:T & lastrow。

setPrintArea() 
Dim LR As Long 
LR = Columns("B:T").Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row 
ActiveSheet.PageSetup.printArea = "B1:T" & LR 
End Sub