简体   繁体   English

自动填充来自另一个工作表的行,条件为特定的单元格值

[英]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.

相关问题 从另一张纸上的特定单元格中搜索值 - Searching for a value from a specific cell on another sheet 从另一个单元格自动填充单元格值 - auto populating cell values from another cell excel将几天添加到日期,然后用它自动填充另一个工作表中的单元格 - excel adding a few days to a date then auto populating a cell in another sheet with it 如何从另一个工作表中的特定单元格开始复制和粘贴行 - How to Copy and Paste Rows starting from a specific cell in another sheet 根据单元格值将行从一个 Excel 工作表复制到另一个 - Copying rows from one Excel sheet to another based on cell value 根据单元格中的值将行从一张表复制到另一张表中 - Copy rows from one sheet into another depending on value in cell 根据单元格值将数据从特定列复制到另一个工作表 - Copy data from specific columns to another sheet based on a cell value 从工作表获取所有行,然后进入另一工作表,其中每一行包含一个与特定值匹配的单元格 - Get all rows from a sheet, into another sheet, where each row contains a cell matching a certain value 如何根据excel中另一个工作表单元格值的特定值填充单元格背景颜色? - How to Fill cell background color depending a specific value from another sheet cell value in excel? 将具有特定值的行复制到另一张工作表 - Copy rows with a specific value to another sheet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM