This is a migrated thread and some comments may be shown as answers.

How can you reorder Worksheets in a Workbook?

1 Answer 25 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Nicholas
Top achievements
Rank 1
Nicholas asked on 15 May 2019, 11:49 AM

I have a number of worksheets in a workbook, but I want to reorder them in a certain way. Is there a way to do this?

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 17 May 2019, 10:24 AM
Hi Nicholas,

You can use the Move() method of the Sheets collection of Workbook to reorder the worksheets to the desired positions:
Workbook workbook = new Workbook();
workbook.Worksheets.Add(); // Sheet1
Worksheet secondWorksheet = workbook.Worksheets.Add(); // Sheet2
workbook.Worksheets.Add(); // Sheet3
workbook.Worksheets.Add(); // Sheet4
 
workbook.Sheets.Move(3, 1, 0); // Move the fourth sheet to the first place

I noticed that this information is missing in our documentation and will make sure it is updated as soon as possible.

Hope this is helpful.

Regards,
Tanya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Spreadsheet
Asked by
Nicholas
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or