在我的第一栏中,我有独特的情节编号。然后,在所有其他栏目的顶部,我都有植物名称:
Acer Quercus Carya Plot1___1________1________1
Plot2___1
Plot3 ___________1________1
Plot4__1__________________1
1表示存在,但我想用列顶部引用的名称替换1。我有成千上万的地块和数以百计的树种,所以它需要自动化。抱歉,上面的格式太糟糕了。
发布于 2014-11-16 19:16:32
这个VBA片段应该可以做到这一点。
Dim column As Integer
For column = 2 To 4 ' Replace from column 2(B) to 4(D).
' Replace each occurance of "1" in the column with the header text.
Columns(column).Replace "1", Cells(1, column).Value
Next只需根据需要处理的列数调整列号以求值即可。
https://stackoverflow.com/questions/26960711
复制相似问题