Reputation: 195
I want to get the selected or focused range in Excel. better returns me a Range object. I knew activeCell, but it only gives me one cell. What I need are a range of cells. Hope you can get my question. Thanks.
Upvotes: 0
Views: 4164
Reputation: 1026
Credit to @Tim as he got here first and gave good start for the answer (give the man an up tick!).
But just to add to it (in C#) . . .
The follow code will provide global scope (Get you the desired info anywhere in your Add-In application).
Microsoft.Office.Interop.Excel.Range stuff =
Globals.ThisAddIn.Application.Selection as Excel.Range;
Notes:
Upvotes: 3