简体   繁体   中英

VBA: Get selected Range in a Worksheet where the Selection is a Chart

I have a Worksheet, with a Chart in it. If I select a range of cells, and then I select the Chart, then in the immediate window of the VBE

? TypeName(Selection)
ChartArea

So I cannot use Selection to get the selected Range , even if it is there (pressing Esc returns to the selected range of cells).

How can I retrieve that Range in VBA?

PS: I suspect the same Q&A applies to other Shape s.

您可以使用Window对象的RangeSelection属性(请参阅此内容 )。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM