我有 10,000 行和无限的列数据。相邻列中的两个参数在 13 个不需要的列之后重复。
我想连接由空格分隔的行的这些相邻列
例如:
连接(B2,C2,"",P2,Q2,"",AC,AD,"",....)
但我不知道数据存在于哪一列。
你能建议我一个宏,它将数据连接到一行的一个单元格中的空白列,并且前 10,000 行继续相同。非常感谢您的帮助!
First off, are all the rows terminating at the same column? i.e. does every row have data in column AD but not AE?
If the answer to the above is 'yes', then you'll probably want to take a look at:
Range.End()
which is used like:
YourSheet.Range(YourRange).End(xlToRight).Column
This will return either
or
Based on your example in the question, your ranges probably start in Column B, P, AC, etc.
If the answer to the above is 'no', then you can use similar functionality, but you'll have to loop through each row...