Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Tue Feb 21, 2017 10:43 am

As question, I want to know is there any way to get multiple range in CellRange object like following:-

Since, I am doing a copy row function, but i need to copy the formula and style from the original row to multple range
xlSheet.InsertRow(wiStrRow, wiExpRow - 1);
CellRange waOrgRange = xlSheet.Range[xlSheet.Rows[wiStrRow].RangeAddress];
CellRange waNewRange = xlSheet.Range[xlSheet.Rows[wiStrRow].RangeAddress + "," + xlSheet.Rows[wiStrRow + wiExpRow - 1].RangeAddress];
xlSheet.Copy(waOrgRange, waNewRange);

Example, xlSheet.Range["A13:F13, A66:F66"], but it becomes error.

Anyone can tell me the correct syntax, Thanks a lot!

trehanson
 
Posts: 5
Joined: Tue Feb 21, 2017 10:34 am

Wed Feb 22, 2017 2:39 am

Dear trehanson,

Thanks for your inquiry.
Sorry that at present Spire.XLS doesn't support do that. But in your case, you can use two Ranges to achieve your target, like this:
Code: Select all
xlSheet.Range["A13:F13"].
xlSheet.Range["A66:F66"].

If there is any question, please let me know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Feb 23, 2017 12:46 am

Hi Betsy,

Thanks for reply. :mrgreen:

trehanson
 
Posts: 5
Joined: Tue Feb 21, 2017 10:34 am

Thu Feb 23, 2017 1:56 am

Dear trehanson,

Thanks for your feedback.
Please feel free to contact us if there is any question :) .

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.XLS