在Excel工作表数据输入表单中编辑记录

How can you make it easy for people to enter and edit data in Excel, but keep them away from the data storage worksheet?

如何使人们在Excel中输入和编辑数据变得容易,却又远离数据存储工作表?

Last year, I posted a Worksheet Data Entry Form in Excel, where users could enter and view Excel data. It was based on a worksheet data entry form that Dave Peterson created.

去年,我在Excel中发布了工作表数据输入表单 ,用户可以其中输入和查看Excel数据。 它基于Dave Peterson创建的工作表数据输入表单。

I've created a new version, where users can enter, view and edit the Excel data.

我创建了一个新版本,用户可以在其中输入,查看和编辑Excel数据。

版本1:添加新记录 (Version 1: Add New Records)

In Dave's original worksheet data entry form, users could add records on the data entry worksheet, and click a button to go to the database sheet, and review or edit the order records.

在Dave的原始工作表数据输入表单中 ,用户可以在数据输入工作表上添加记录,然后单击一个按钮转到数据库表,然后查看或编辑订单记录。

Excel data entry form

版本2:查看现有记录 (Version 2: View Existing Records)

In version 2, I added a few buttons to Dave's workbook, to allow users to scroll through the existing records. With the navigation buttons, you could go to the first, previous, next or last record, or type a record number, to go to a specific record.

在版本2中,我在Dave的工作簿中添加了一些按钮,以允许用户滚动浏览现有记录。 使用导航按钮,您可以转到第一条记录,上一条记录,下一条记录或最后一条记录,或者键入记录编号以转到特定记录。

Excel data entry form scroll

版本3:更新现有记录 (Version 3: Update Existing Records)

In the latest version of the Excel Worksheet Data Entry form, I've added an update feature. As in the previous version, there are data validation drop down lists, to select Item and Location. The Price calculation is based on a VLOOKUP formula, and the Total formula multiplies the quantity by the price.

在最新版本的Excel工作表数据输入表单中,我添加了更新功能。 与以前的版本一样,还有数据验证下拉列表 ,用于选择项目和位置。 “价格”计算基于VLOOKUP公式 ,“总计”公式将数量乘以价格。

After you select a record, you can change its data, then click the Update button to copy those changes to the database.

选择记录后,可以更改其数据,然后单击“更新”按钮将这些更改复制到数据库。

Excel data entry form update

For example, in the record shown above, if you discovered that there was an error, you could change the quantity from 500 to 200. The Total formula would automatically recalculate, to show the new total of $200.00.

例如,在上面显示的记录中,如果发现有错误,可以将数量从500更改为200。Total公式将自动重新计算,以显示新的总计$ 200.00。

Then, click the Update button, and the revised quantity and total would appear in that record on the database sheet.

然后,单击“更新”按钮,修订的数量和总数将显示在数据库表的该记录中。

更新代码 (The Update Code)

Before updating the database record, the Update code checks to see of all the data entry cells are filled in. If they aren't, a warning message appears, and the macro stops running. This prevents you from accidentally overwriting an existing record with blank cells.

在更新数据库记录之前,更新代码将检查是否已填写所有数据输入单元。如果没有,则会显示警告消息,并且宏将停止运行。 这样可以防止您意外地用空白单元格覆盖现有记录。

Excel data entry message

If all the data entry cells are filled in, the code:

如果所有数据输入单元均已填写,则代码:

  • writes the current date and time in the applicable row of the database

    将当前日期和时间写入数据库的适用行
  • adds the User Name from the Excel application

    从Excel应用程序添加用户名
  • copies the data to the database

    将数据复制到数据库
  • clears the data entry cells

    清除数据输入单元

Then, with a cleared data entry sheet, you can go on to add, view and edit other records, or save and close the workbook.

然后,使用已清除的数据输入表,您可以继续添加,查看和编辑其他记录,或者保存并关闭工作簿。

下载样本文件 (Download the Sample File)

The zipped sample workbook, in Excel 2003 format, can be downloaded from the Contextures website: Worksheet Data Entry Form ___________

可以从Contextures网站上下载Excel 2003格式的压缩示例工作簿: 工作表数据输入表 ___________

翻译自: https://contexturesblog.com/archives/2010/03/14/edit-records-in-excel-worksheet-data-entry-form/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值