我想要一个组合范围。 如何将两个范围合并为一个?
Dim range1 as Excel.Range = osheetTemperatureData.Range("A7:"A10")
Dim range2 as Excel.Range = osheetTemperatureData.Range("C7:"C10")
Dim range3 as Excel.Range = range1 + range2 '????
答案 0 :(得分:1)
请参阅此Microsoft知识库文章:15: How to Select the Union of Two or More Specified Ranges
您需要使用Excel.Application
对象,然后执行以下操作:
Dim range3 as Excel.Range = xlApp.Union(range1, range2)