开发者

Union ranges in Excel Interop

I want a combined Ranges. How do I combine two ranges into one?

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 '????


See this Microsoft KB article: 15: How to Select the Union of Two or More Specified Ranges

You need to use the Excel.Application object and then do something like:

Dim range3 as Excel.Range = xlApp.Union(range1, range2)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜