使用VBA过滤和更新Excel中的列
我有四列:姓名,代码,被雇用和射击。 代码列中的值是唯一的。 一年中可以雇用和开除几次,但我只需要第一次被录用,而只是最后一次被解雇。 我可以使用VBA过滤和更新这些列吗?
我所拥有的是从A到D的列中的值。我想要的是从i到l的列中的值
。 >
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您有Office 365,则可以使用其他答案之一中概述的公式来执行此操作。
这也可以使用电源查询来完成,该电源查询可在Windows Excel 2010+和Excel 365(Windows或Mac)中使用,
以使用电源查询
data =>获取& transform =>从表/范围
或从表格中
home =>高级编辑器
应用步骤
以了解算法m代码
If you have Office 365, you can do this with formulas as outlined in one of the other answers.
This can also be accomplished using Power Query, available in Windows Excel 2010+ and Excel 365 (Windows or Mac)
To use Power Query
Data => Get&Transform => from Table/Range
orfrom within sheet
Home => Advanced Editor
Applied Steps
to understand the algorithmM Code
使用词典与最大和最小的唯一
Unique With Max and Min Using a Dictionary
因此,如果您不知道如何编写 vba代码,那么您也可以尝试使用 excel formulas ,您肯定需要访问 o365 或 o365 o365内部人员beta版本
•cell
f2
f2 < /code>获得
唯一名称
&amp;代码
,•在单元格> H2 中使用的公式
•cell
i2
使用
let()更容易读取和 Leaws ,
Cell
•使用
f9
使用lambda()
函数to ,•公式创建自定义
,可重复使用
功能,并通过友好名称
,
lambda()
name manager 中使用的功能 定义的名称 aS hirefire 带有语法在其中,
•因此,在
f15
中使用的公式,由于您尚未提及excel版本,因此您可能正在使用
excel 2019
或2016
代码>或2013
因此,因此,如下所示的替代方案,•cell
f2
中使用的公式>上述公式,是一个数组公式,需要按
ctrl
+shift
+ENTER
基于您的Excel版本,•cell
g2
中使用的公式单元
H2
- &GT; 适用于Excel 2019&amp;上面如果不使用上述任何一个版本,则
其数组公式,因此需要按
ctrl
+shift> shift> shift
+enter
填写!•单元格中使用的公式
i2
- &gt; 适用于Excel 2019&amp;上面如果不使用上述任何一个版本,则
其数组公式,因此需要按
ctrl
+shift> shift> shift
+enter
填写!So, if you are not aware of how to write VBA Code, then you may try using Excel Formulas as well, however for the following formulas, you definitely need to have access either to O365 or O365 Insiders Beta Version
• Formula used in cell
F2
to get theUnique Name
&Codes
,• Formula used in cell
H2
• Formula used in cell
I2
Using
LET()
makes easier to read and understand,• Formula used in cell
F9
Using
LAMBDA()
Function to create acustom
,reusable
function and refer them by afriendly name
,LAMBDA()
Function used in Name Manager with a Defined Name as HireFire with syntax asWhere,
• Therefore, Formula used in cell
F15
Since you have not mentioned your Excel Version, it may happen you are using either
Excel 2019
or2016
or2013
so on so forth, hence, alternatives shown below,• Formula used in cell
F2
The above formula, is an array formula and needs to press
CTRL
+SHIFT
+ENTER
based on your Excel Versions,• Formula used in cell
G2
• Formula used in cell
H2
--> Applicable To Excel 2019 & AboveIf not using either of the above version then,
Its an array formula, hence needs to press
CTRL
+SHIFT
+ENTER
and fill down!• Formula used in cell
I2
--> Applicable To Excel 2019 & AboveIf not using either of the above version then,
Its an array formula, hence needs to press
CTRL
+SHIFT
+ENTER
and fill down!