自动打印行1-5,然后每页打印6-10等 [英] Automatically Printing rows 1-5, then 6-10 etc. per page

查看:146
本文介绍了自动打印行1-5,然后每页打印6-10等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个750个家庭地址的列表,一个慈善机构将提供感恩节晚餐。我需要把一个5个家庭的页面交给150个不同的司机。

I have an excel list of 750 family addresses that a charity will be delivering Thanksgiving dinners to. I need to hand a page of 5 families to 150 different drivers.

有没有办法在一页上自动打印1-5行,然后在下一页6-10打印?直到所有750个家庭都被打印?

Is there a way to automatically print rows 1-5 on one page, then 6-10 on the next page etc. until all 750 families are printed?

尝试使用大的底部边距,但不能一致地工作,因为某些行对其他家庭的文字数量较大。

Tried using a large bottom margin but doesn't work consistently as some rows have a larger amount of text about the families that others.

推荐答案

这可以很容易地用宏完成。

This can be easily done with a macro.


  1. 打开您的Excel文件并显示包含所有
    地址的表单

  2. 按Alt + F11打开Visual Basic编辑器

  3. 选择插入>模块添加新模块

  4. 粘贴以下代码。 / p>

  1. Open your excel file and display the sheet containing all of the addresses
  2. Press Alt+F11 to open the Visual Basic Editor
  3. Select Insert > Module to add a new Module
  4. Paste the following code.

Sub formatSheets()

For i = 5 To 750 Step 5
    ActiveSheet.HPageBreaks.Add Before:=Cells(i + 1, 1)
Next
End Sub


  • 选择运行>运行子/用户窗体以运行宏

  • 这将格式化工作表以在每五年后添加一个分页符行,导致150张,每个地址有5个地址。

    This will format the sheet to add a page break after every five rows, resulting in 150 sheets with 5 addresses each.

    就是说,只有5个地址的150张。在一张纸上将两组五个地址分别手动切割一半就足够了? :)

    That being said, that's 150 sheets for just 5 addresses. Would 2 groups of five addresses on one sheet and manually cutting them in half suffice? :)

    这篇关于自动打印行1-5,然后每页打印6-10等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆