2016-09-22 140 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