我正在寻找一种能够根据单元格上方有一个空单元格的事实来查找单元格列标题的方法。以下是上下文:
我想要生成一列包含所有名称的列,并在相邻的列中显示与它们关联的标题。
我有一个名字列表,每个名字都有一个标题,例如
header 1 <blank> header 2 <blank>
1 First Last 1 First Last
2 First Last 2 First Last
3 First Last 3 First Last
... ... ... ...
header 3 <blank> header 4 <blank>
1 First Last 1 First Last
2 First Last 2 First Last
3 First Last 3 First Last
... ... ... ...
我正在尝试:
Names Headers
First Last header 1
First Last header 1
First Last header 1
... ...
First Last header 2
First Last header 2
First Last header 2
... ...
First Last header 3
First Last header 3
First Last header 3
... ...
First Last header 4
First Last header 4
First Last header 4
... ...
看来我必须有某种东西可以爬取电子表格来寻找“姓名”,并且每次找到姓名时,它都会向上移动列直到遇到空白处,然后向左移动一个单元格。然后,复制该文本,并创建两个包含姓名和标题文本的新列。我该如何开始做这件事?
这是一个示例算法
1 Create a new worksheet that’s a copy
2 Find all cells with just a number; delete, move left
3 Find cells with empty cell above. These are headers
4 For every cell that is not a header,
a Find the associated header
b Print the name and header in a new sheet