问题
I need to be able to use C# and Excel interop to determine which cells are selected in a workbook/worksheet. It would be nice if there were something like this defined in Excel:
Excel.Range Worksheet.GetSelectedCells();
But I don't find that in any documentation. How can I do this?
tia.
回答1:
Use Application.Selection
which will return a Range.
回答2:
I guess you can use the ActiveCell property of the Excel Application object. It would return you a Range object.
HTH Rauts
来源:https://stackoverflow.com/questions/3978179/how-do-i-find-which-cells-are-selected-on-an-excel-worksheet