简体   繁体   English

更新 B 到 Z 范围内的数据时,自动更新 A 列中的日期和时间数据

[英]Automatically update date and time data in column A when updating data in the range from B to Z

Automatically update date and time data in column A when updating data in the range from B to Z. Suppose I have a table of data located in the range B1:Z100, when I update the data in cell B1, the date and time in A1 will automatically update, and will automatically lock that data cell every time I press enter in case I accidentally pressed the wrong button.更新 B 到 Z 范围内的数据时自动更新 A 列中的日期和时间数据。假设我有一个位于 B1:Z100 范围内的数据表,当我更新单元格 B1 中的数据时,A1 中的日期和时间会自动更新,每次我按回车时都会自动锁定那个数据单元格,以防我不小心按错了按钮。 And when I update the data in cell B1, when I press Enter, it will display a message board whether I want to update new data to replace the old data.而当我更新单元格B1中的数据时,当我按Enter键时,它会显示一个留言板是否要更新新数据以替换旧数据。 If agree, then press yes, and data cell B1 will be update the new data, and in cell A1 will update the date and time of the latest update at the same time.如果同意,则按是,数据单元格 B1 将更新新数据,并且单元格 A1 将同时更新最新更新的日期和时间。 Hope everyone can help me, thank you so much.希望大家能帮帮我,非常感谢。

Consider using the Worksheet_Change event.考虑使用Worksheet_Change事件。 This will fire every time a change is made to the worksheet.每次对工作表进行更改时都会触发。 In this sub, you can check for the row that was editted, and then you can ask the user the question about updating data.在此子中,您可以检查已编辑的行,然后您可以向用户询问有关更新数据的问题。 Here's the official documentation 这是官方文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM