[英]Auto populating rows from another sheet conditional to a specific cell value
Hello i am trying to autopopulate rows from another sheet if a specific value if found in a specific cell. 您好,我正在尝试自动填充另一张工作表中的行(如果在特定单元格中找到了特定值)。 So far, i managed to do it manually by adding this line in Sheet #2 for each cell.
到目前为止,我设法通过在工作表#2中为每个单元格添加此行来手动完成此操作。
=IF(OR('Le 2250'!$C48="Nouveau locataire",'Le 2250'!$C48="Décès", 'Le 2250'!$C48="Retention"), 'Le 2250'!$B48,"")
I am trying to create a vba script that will generate each column in Sheet#2, and that will dynamically update regarding if i add a row in Sheet 1 or delete it. 我正在尝试创建一个vba脚本,该脚本将生成Sheet#2中的每一列,并且会动态更新有关我在Sheet 1中添加一行还是删除它的信息。
Sheet1 is: Sheet1是:
Sheet2 is: Sheet2是:
Your help is appreciated 感谢您的帮助
What your looking for is the INDIRECT function 您正在寻找的是INDIRECT函数
As an example: 举个例子:
=CELL("contents",INDIRECT("Sheet1!B5"))
This always pick up the value in Sheet1 Cell B5, regardless of changes in Sheet1. 无论Sheet1中的更改如何,这始终会获取Sheet1单元格B5中的值。
For more information: Excel INDIRECT Function 有关更多信息: Excel INDIRECT函数
Edit: To directly answer the question with INDIRECT. 编辑:直接用INDIRECT回答问题。
=IF(OR(INDIRECT("'Le 2250'!C48")="Nouveau locataire",INDIRECT("'Le 2250'!C48")="Décès"),CELL("contents",INDIRECT("'Le 2250'!B48")),"")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.