Note: The other languages of the website are Google-translated. Back to English
登陆  \/ 
x
or
x
点此注册  \/ 
x

or

如何在Excel的下拉列表中打印所有选项?

您是否曾经尝试在Excel工作表的下拉列表中打印所有选项? 本文讨论的是将下拉列表中的所有选项打印到Excel中的单独打印输出中。

使用VBA代码在下拉列表上打印所有选项


使用VBA代码在下拉列表上打印所有选项


以下VBA代码可以帮助您在工作表的下拉列表中打印所有选项。 请执行以下操作。

1。 按 其他 + F11 键打开 Microsoft Visual Basic应用程序 窗口。

2。 在里面 Microsoft Visual Basic应用程序 窗口,请点击 插页 > 模块。 然后将以下VBA代码复制到“模块”窗口中。 看截图:

VBA代码:将指定下拉列表中的所有选项打印到单独的打印输出中

Sub Iterate_Through_data_Validation()
    Dim xRg As Range
    Dim xCell As Range
    Dim xRgVList As Range
    Set xRg = Worksheets("Sheet1").Range("B8")
    Set xRgVList = Evaluate(xRg.Validation.Formula1)
    For Each xCell In xRgVList
        xRg = xCell.Value
        ActiveSheet.PrintOut
    Next
End Sub

备注:在代码中,Sheet1是工作表名称,其中包含您要打印的下拉列表。 B8是包含下拉列表的单元格。 请用您需要的替换它们。

3。 按 F5 键来运行代码。

然后,单独打印出特定工作表中指定下拉列表中的所有选项。


在Excel当前工作表中轻松打印指定的页面:

随着 打印特定页面 实用程序 Kutools for Excel,您可以轻松打印当前工作表中的指定页面,例如全部打印 奇数页所有 偶数页,只打印 当前页面,以及打印自定义页面范围,如下图所示。
立即下载并尝试! (30天免费试用)


相关文章:


最佳办公效率工具

Kutools for Excel解决了您的大多数问题,并使您的生产率提高了80%

  • 重用: 快速插入 复杂的公式,图表 以及您以前使用过的任何东西; 加密单元 带密码 创建邮件列表 并发送电子邮件...
  • 超级公式栏 (轻松编辑多行文本和公式); 阅读版式 (轻松读取和编辑大量单元格); 粘贴到过滤范围...
  • 合并单元格/行/列 不会丢失数据; 拆分单元格内容; 合并重复的行/列...防止细胞重复; 比较范围...
  • 选择重复或唯一 行; 选择空白行 (所有单元格都是空的); 超级查找和模糊查找 在许多工作簿中; 随机选择...
  • 确切的副本 多个单元格,无需更改公式参考; 自动创建参考 到多张纸; 插入项目符号,复选框等...
  • 提取文字,添加文本,按位置删除, 删除空间; 创建和打印分页小计; 在单元格内容和注释之间转换...
  • 超级滤镜 (将过滤方案保存并应用于其他工作表); 高级排序 按月/周/日,频率及更多; 特殊过滤器 用粗体,斜体...
  • 结合工作簿和工作表; 根据关键列合并表; 将数据分割成多个工作表; 批量转换xls,xlsx和PDF...
  • 超过300种强大功能。 支持Office / Excel 2007-2019和365。支持所有语言。 在您的企业或组织中轻松部署。 完整功能30天免费试用。 60天退款保证。
kte选项卡201905

Office选项卡为Office带来了选项卡式界面,使您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
officetab底部
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    mich · 2 months ago
    Thanks i used the first option it s amazing but i need to add to it that if there is a blank cell it should not print that option
  • To post as a guest, your comment is unpublished.
    Mich · 2 months ago
    Thanks i used the first option it s amazing but i need to add to it that if there is a blank cell it should not print that option
  • To post as a guest, your comment is unpublished.
    Zack · 1 years ago
    Hi is there a way to be able to preview first all the possible printouts in my drop-down list before it actually prints?
  • To post as a guest, your comment is unpublished.
    tj123 · 1 years ago
    How can i select a specific droplist, i want to print? , For example if i have 200 names on my droplist and i want to print a specific list, maybe 50 out of 200, How will i do this please?
  • To post as a guest, your comment is unpublished.
    Cloud · 1 years ago
    Thanks for the code. But I'm experiencing a minor issue when printing. When I tried to print the sheet with the drop down list. The first print out, prints the first item on the list while the next print out prints a blank data before it prints the second item from the list. What should I do?
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Hi Cloud,
      What version of Excel are you using?
      The problem can't be reproduced in my case. Sorry for the inconvenience.
      • To post as a guest, your comment is unpublished.
        Cloud · 1 years ago
        Sorry I totally forgot about this. I'm using Excel 2013.

        So it wasn't actually a blank data.

        I have this dynamic drop down list in cell R17 which also populates other cells in the worksheet using VLOOKUP Function. What happens during print out is that the odd-positioned items on the list appears on the cell while the even-positioned items seemed not to show up that's why I thought it's printing blank pages.

        Thanks!
  • To post as a guest, your comment is unpublished.
    Juliette · 3 years ago
    Thank you for the post, this has helped me a lot. I was wondering if you had a way to do VBA to print Page 1 based on one drop-down selection and print Page 1 and 2 based on another drop-down selection? Thanks for any help you can provide.