none
Excel - Getting Range of Selected Cells

    Question

  • Hi,

    Is there a way to get the range of cells selected in an ActiveSheet.

    string cellAddress =
                        Globals.ThisAddIn.Application.ActiveCell.get_Address(true, true, Excel.XlReferenceStyle.xlA1, null, null);

    gives just the first cell in that range. Is there a way to get the range of selected cells in the active worksheet?


    M
    Tuesday, May 06, 2008 8:13 PM

Answers

  • Try using the Selection object instead of the ActiveCell object. (Since you're using C# you may need to explicitly type the object to a Range object, first.)

    Globals.ThisAddin.Application.Selection

    Wednesday, May 07, 2008 7:16 AM