简体   繁体   English

从单元格J中包含“是”的Sheet1复制行并将其粘贴到Excel 2007中的Sheet4

[英]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: 一种方法是:

  • Filter on column J for "YES" only. 仅在J列上过滤“是”。
  • Copy those rows to Sheet4. 将这些行复制到Sheet4。

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.

相关问题 如果单元格的颜色为绿色,则从 Sheet1 复制一行并将其粘贴到 Sheet 2 - Copy a row from Sheet1 and paste it into Sheet 2 if color of a cell is green Excel 2013 VBA - 以编程方式从工作表2上的一个单元格复制文本,粘贴到Sheet1模块 - Excel 2013 VBA - Programmatically Copy text from one Cell on Sheet 2, Paste into Sheet1 Module 如何将第一行从 Sheet1 移动到 Sheet2,将 Sheet1 上的第二行移动到 Sheet3,将 Sheet1 上的第三行移动到 Sheet4 然后重复? - How to move first row from Sheet1 to Sheet2, move second row on Sheet1 to Sheet3, move third row on Sheet1 to Sheet4 then repeat? 从Sheet1复制范围并将其粘贴到Sheet 2中 - Copy Range from Sheet1 And paste it in Sheet 2 如果 Sheet4 上的单元格不是空白/空,则使 Sheet1 上的单元格值 = Sheet4 上的单元格值 - If cell on Sheet4 is not blank/empty, then make Values of cells on Sheet1 = Values of cells on Sheet4 从Sheet3复制一行,粘贴到Sheet1,另存为文件,然后转到Sheet 3的下一行 - Copy a row from Sheet3, paste into Sheet1, save as file, then go to the next row of Sheet 3 复制范围工作表1粘贴到活动单元格工作表2中 - Copy Range Sheet1 Paste in Active Cell Sheet 2 复制范围表1粘贴到所选单元格表2中 - Copy range sheet1 paste in selected cell sheet 2 如果工作表sheet2上的单元格与工作表sheet1上的单元格匹配,则将行从工作表2复制到工作表1并循环到下一行 - If cell on sheet2 row1 matches cell on sheet1 then copy row from sheet 2 to sheet 1 and loop for next row 将非空白单元格从 sheet1 复制并粘贴到 sheet2 - Copy and paste nonblank cells from sheet1 to sheet2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM