I am using range.group
method from the Microsoft.Office.Interop.Excel.dll
and it works to group up the columns or rows as the outline level in the Excel document;
but there comes the question of how to set the "+"
symbol at the left side, but not it's default position at the right side according to the last columns or rows.
What method is used for controlling the direction and how to use this method. It would be best if that's an example,.
In excel: Data/Group and Outline/Settings...
In code:
range.Group(oMissing, oMissing, oMissing, oMissing);
//for rows
worksheet.Outline.SummaryRow = Excel.XlSummaryRow.xlSummaryAbove;
//for columns
worksheet.Outline.SummaryColumn = Excel.XlSummaryColumn.xlSummaryOnLeft;
To apply it on the left without using VBA:
In Excel: Data-> Outline. Click on the arrow on the bottom right corner of the ribbon (The arrow is pointing down right.)
It will open the Outline Settings.
Untick "Summary column on the right on the right of detail." Click Apply Styles.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With