謝謝Hsieh,GBKEE兩位版主的指導,自動分頁可以這寫:
Sub 自動分頁
Dim page_count As Long
Dim i As Long
Dim row_index As Long
Dim str_row_index As String
Dim first_row As Long
Dim jump_page
ActiveWindow.View = xlPageBreakPreview
first_row = 50
jump_page = 50
For i = first_row To rows_count Step jump_page
page_count = page_count + 1
str_row_index = "A" + Trim(Str(i + 1))
Set ActiveSheet.HPageBreaks(page_count).Location = Range(str_row_index)
Next i
ActiveWindow.View = xlNormalView
End Sub