Mikkel Nielsen
Mikkel Nielsen

Reputation: 792

Need to access selected data from a excel addin (Visual C#)

Im trying to build a addin that can take some a selection of cells from a excel sheet and then put them together in the first cell i have celected. Between the cells there will be a user selected seperator.

example: I select the 3 cells A1-A3 with the values A B and C I then bring up my addin and chose the seperator to be ", ". The addin should then place a the String "A, B, C" in the cell A1.

But I cant figure out how to access the data I have selected in the excel sheet.

Upvotes: 1

Views: 1408

Answers (1)

Hugh Lacey
Hugh Lacey

Reputation: 46

var range = (Range)Globals.ThisAddIn.Application.ActiveWindow.Selection;

Upvotes: 3

Related Questions