[英]Copy and Paste a Row from Sheet1 Containing “YES” in Cell J to Sheet4 in Excel 2007
I have been looking for an answer to this issue for several days by using google and various Excel troubleshooting sites. 几天来,我一直在使用Google和各种Excel故障排除网站来寻找该问题的答案。 Unfortunately, I am 100% unfamiliar with Macros in Excel and my training isn't until April (I am signed up though!).
不幸的是,我100%不熟悉Excel中的宏,并且直到4月我才接受培训(不过我已经注册了!)。 Becuase I just don't understand the programming, I am having a hard time "fixing" solutions online to meet my needs.
因为我只是不懂程序设计,所以我很难在网上“修复”解决方案以满足我的需求。 I really need to have this specifically laid out for my situation.
我确实需要针对我的情况对此进行专门设计。
I have a spreadsheet containing Sheet1 and Sheet4. 我有一个包含Sheet1和Sheet4的电子表格。 Sheet1 has data in columns AL and can have unlimited rows.
Sheet1在AL列中有数据,并且可以有无限行。 When the value "YES" is entered in column J, I would like the macro to copy and paste that whole row into Sheet 4 in the next empty row.
当在列J中输入值“ YES”时,我希望宏将整个行复制并粘贴到下一个空行的Sheet 4中。
Could anyone help? 有人可以帮忙吗? This project must be completed by Monday, March 19. Thank you!
该项目必须在3月19日,星期一之前完成。谢谢!
If you are 100% unfamiliar with Macro, I do not recommend you start off by fixing solutions online. 如果您100%不熟悉Macro,我不建议您从在线修复解决方案开始。
You can try record Macro in order to generate some code. 您可以尝试记录宏以生成一些代码。 One way could be:
一种方法是:
And then you can make modification to the code. 然后,您可以修改代码。 (I think they are easy enough to understand).
(我认为它们很容易理解)。 It will help if you can post the codes you have tried.
如果您可以发布您尝试过的代码,它将有所帮助。
If you want to trigger this action only when a button is pressed, you can simply create that button and assign it to your macro (Sub). 如果只想在按下按钮时才触发此操作,则只需创建该按钮并将其分配给宏(子)即可。
If you want this to happen automatically, you will have to try the Worksheet_Change Event
mentioned by Siddharth 如果您希望这种情况自动发生,则必须尝试Siddharth提到的
Worksheet_Change Event
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.