[英]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. 根据您的要求,我将使用
Offset
或Indirect
函数来执行此操作,这样我就可以控制要从其他工作表中拉入的单元格。
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.