简体   繁体   English

我在Excel中有一列,它从另一个电子表格中的另一列获取数据。 如何在每个单元格后添加一个空行?

[英]I have a column in Excel which gets data from another column, in another spreadsheet. How do I add an empty row after every cell?

As the title suggests, I have a column in my first worksheet which gets its data from another column, in a second spreadsheet. 就像标题所暗示的那样,我在第一个工作表中有一个列,该列从第二个电子表格中的另一列中获取数据。

I have linked them using ='Data'!B1 我已经使用='Data'!B1链接了它们

Of course, if I drag the handle down, I get all the remaining data from the linked column, but I would like to have an empty row after each cell. 当然,如果我向下拖动手柄,则会从链接列中获取所有剩余数据,但是我想在每个单元格后都有一个空行。

Like so: B1 has data, B2 is blank, B3 has data, B4 is blank, etc. 像这样:B1有数据,B2为空白,B3有数据,B4为空白,依此类推。

If some kind person out there could help me out, I would appreciate it very much. 如果有一个友善的人可以帮助我,我将非常感激。 I have tried macros and looked this up in forums but can't seem to make this work with Data --> Sort. 我尝试过宏并在论坛中进行了查找,但似乎无法通过Data-> Sort使它起作用。

Thank you! 谢谢! :) :)

Given what you're asking for, the way I would do it would be using the Offset or Indirect function so I can control which cells to pull in from the other sheet. 根据您的要求,我将使用OffsetIndirect函数来执行此操作,这样我就可以控制要从其他工作表中拉入的单元格。

Given your example, in Sheet1, I would have: 以您的示例为例,在Sheet1中,我将:

B1: =OFFSET(Sheet2!$B$1,(ROW(B1)-1)/2,0)
B2: <blank>
B3: =OFFSET(Sheet2!$B$1,(ROW(B3)-1)/2,0)
B4: <blank>

You can drag this down and it will give you alternating formula / blanks and pull the consecutive row from the other sheet. 您可以向下拖动它,它将为您提供交替的公式/空格,并从另一张纸上拉出连续的行。

As a quick explation, the function will always look at cell B1 in your second sheet and offset it by (Row()-1)/2 rows... So, in row 1, it would offset it by (1-1)/2 = 0 rows, in row 3, it would offset it by (3-1)/2 = 1 rows, etc. 作为快速解释,该函数将始终查看第二张工作表中的单元格B1并将其偏移(Row()-1)/2行...因此,在第1行中,它将使其偏移(1-1)/2 = 0行,在第3行中,它将偏移(3-1)/2 = 1行,依此类推。

Hope this makes sense and does the trick!! 希望这有意义并能解决问题!

暂无
暂无

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

相关问题 如何每隔 n 行将一列中的一个单元格交换到另一列中的另一个单元格 - how do I swap a cell in a column to another cell in another column for every nth row 如何在excel中创建一个公式来搜索行中的值,然后从该列中的另一个单元格中获取值? - How do I create a formula in excel that searches for a value in row, and then takes the value from another cell in that column? 如何根据另一列过滤电子表格数据? - How Do I Filter Spreadsheet Data Based On Another Column? 如何在excel 2010电子表格中删除任何列中没有单元格注释的行 - How can I remove any row which has no cell comments in any column, in an excel 2010 spreadsheet 如果特定列中的单元格有数据,如何告诉 Excel 宏删除整行? - How do I tell an excel macro to delete the entire row if cell in a specific column have data? 如何将Excel中具有字母数字值的文本导出到另一列? - How do I export text from an excel cell with alphanumeric values into another column? 如何根据在另一列中选择的行数据从列中收集值? - How do I collect value from a column base on it's row data selected in another column? 如何使用另一列的信息过滤一列并将其添加在一起,我需要使用单元格来查找 - How to filter and add together one column using the information of another column, which I need to find using a cell 在excel中,如何通过在另一个单元格中搜索第1列中的值来返回第2列? - In excel, how do I return column 2, by searching for the values in column 1 in another cell? 如何将一列中的日期与另一列中同一行中的单元格进行比较? - How do I compare dates in one column to a cell in the same row in another column?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM