简体   繁体   English

在新工作表中剪切复制粘贴并在新列中将状态更新为“已更新”

[英]Cut Copy Paste in new sheet and updates status as “Updated” in new column

I have data of 2 columns in sheet1 which a macro copies to sheet 2 and remove the same from sheet1!我在工作表 1 中有 2 列数据,宏将其复制到工作表 2 并从工作表 1 中删除相同的数据! what I want is after macro paste data in sheet2 to there is a 3rd column viz status, this status column should be filed with status "updated".我想要的是在 sheet2 中的宏粘贴数据后有第三列即状态,此状态列应以“已更新”状态归档。 表 1 (POL)

数据和宏按钮所在的 Sheet2

So after I run the macro the data is pasted in sheet2 but I also want that status column to be filled automatically as Updated.因此,在运行宏后,数据将粘贴到 sheet2 中,但我还希望该状态列自动填充为已更新。 Macro copy-pastes the data into sheet2 but does not update the status column!!!宏将数据复制粘贴到 sheet2 中,但不更新状态列!!! Please help....请帮忙....这是我得到的错误

you cannot test a range of value in the same time in your if statement.您不能在 if 语句中同时测试一系列值。 That's why you have "Type mismatch".这就是为什么你有“类型不匹配”的原因。

Please try to use a for statement instead :请尝试使用 for 语句代替:

for i = 2 to 100
    if range("B" & i).value = "FST" then
        range("C" & i).value = "updated"
    end if
next

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

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