Jay
Jay

Reputation: 10470

How do I find which cells are selected on an Excel worksheet?

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();

Upvotes: 4

Views: 6972

Answers (2)

rauts
rauts

Reputation: 1018

I guess you can use the ActiveCell property of the Excel Application object. It would return you a Range object.

Upvotes: 0

SwDevMan81
SwDevMan81

Reputation: 50028

Use Application.Selection which will return a Range.

Upvotes: 10

Related Questions