- 帖子
- 5923
- 主題
- 13
- 精華
- 1
- 積分
- 5986
- 點名
- 0
- 作業系統
- win10
- 軟體版本
- Office 2010
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台灣基隆
- 註冊時間
- 2010-5-1
- 最後登錄
- 2022-1-23
        
|
回復 5# luke - Sub TEST()
- Dim iPageCount As Integer, i As Integer
- Application.ScreenUpdating = False
- With Sheets("Sheet1")
- For i = .UsedRange.Rows.Count To 9 Step -1
- If Application.Phonetic(.Rows(i)) = "" Then .Rows(i).Delete
- Next
- .Activate
- .PageSetup.PrintTitleRows = "$1:$5" '標題列
- iPageCount = (.[A7].CurrentRegion.Rows.Count - 2) / 14
- .Cells(5, "O").Value = iPageCount
- For i = 1 To iPageCount
- .Cells(5, "M").Value = i
- .Range(.Cells(9 + ((i - 1) * 14), "a"), .Cells(22 + ((i - 1) * 14), "O")).Name = "Print_Area" '印列範圍
- .PrintPreview '.PrintOut '印列
- Next
- .Names("Print_Area").Delete
- .Names("Print_Titles").Delete
- End With
- Application.ScreenUpdating = True
- End Sub
複製代碼 |
|