excel vba打印模板_Excel VBA视频:打印前显示消息

本文介绍了一种在Excel VBA中实现打印前自动检查客户名称是否填写的方法,通过宏编程防止因缺失信息而造成的纸张浪费,展示了如何记录、编辑宏及在打印前显示警告消息。

excel vba打印模板

If the customer name is missing from an Excel worksheet order form, you'll waste paper if you print that order form, and then have to reprint it.

如果Excel工作表订单中缺少客户名称,则在打印该订单时会浪费纸张,然后必须重新打印。

See how to prevent that from happening, with a macro to show a message before printing.

查看如何防止这种情况的发生,并使用宏在打印之前显示一条消息。

检查客户名称 (Check for a Customer Name)

Here's the Order form worksheet, with a customer name selected. This macro will check that cell, to make sure that it isn't empty, before printing.

这是订购表单工作表,其中已选择客户名称。 该宏将在打印之前检查该单元格,以确保其不为空。

ExcelMessage01

显示错误讯息 (Show an Error Message)

Previously, you saw instructions for automatically showing an error message before printing, if data is missing from an Excel worksheet.

以前,您看到了有关 Excel工作表中缺少数据时在打印之前自动显示错误消息的说明。

If a Customer name is not selected, the macro will prevent people from printing the order form.

如果未选择客户名称,则该宏将阻止用户打印订单。

CustMsg06

请参阅此视频中的步骤 (See the Steps in This Video)

Well, it took a long time (okay, half a year), but I finally uploaded a video that shows those steps.

嗯,花了很长时间(好的,半年),但是我最终上传了一个显示这些步骤的视频。

Instead of reading the steps, you can watch how to do them. Then, try this technique in your own workbooks.

无需阅读这些步骤,您可以观察如何进行操作。 然后,在您自己的工作簿中尝试此技术。

演示地址

查看所有宏步骤 (See All the Macro Steps)

See all of the steps and all 5 videos on my Contextures website, on the Getting Started with VBA page.

在Contextures网站上的“ VBA入门”页面上,查看所有步骤和所有5个视频。

The instructions and  videos show how to do these steps:

说明和视频显示了如何执行以下步骤:

  • Record a Macro in Excel

    在Excel中记录宏
  • Edit the Recorded Macro

    编辑录制的宏
  • Show a Message in Excel

    在Excel中显示消息
  • Show a Message Automatically

    自动显示消息
  • Show a Message Before Printing

    打印前显示消息

翻译自: https://contexturesblog.com/archives/2010/07/07/excel-vba-video-show-message-before-printing/

excel vba打印模板

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值