ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2014-12-05 22:26:40

dadu
Member
From: Berlin, Germany
Registered: 2014-12-05
Posts: 1

Multisheet - copy and move sheets

Hi Jing,
thanks for your good job. I'll replace all my Excel related codes with your component. Can I move or copy a sheet within or in to a (new) workbook like Excel? e.g.:

Sheets("Sheet1").Copy After:=Sheets(1)
Sheets("Sheet2").Move Before:=Workbooks("Mappe1").Sheets(2)

It may be an item in my wishlist, when you doesn't implemented yet ;-)
Thank you in advance

dadu

Offline

#2 2014-12-06 02:53:01

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Multisheet - copy and move sheets

Hi dadu, thanks!

Now I'm trying to implement it in 0.8.8 version, thanks for suggestions!

Edit: It has been implemented and available at the latest download: http://reogrid.net/download/

Below are the sample code (usage in 0.8.8):

Duplicate worksheet (from 0 to 1, zero-based number of worksheet)

var workbook = grid;

var sheet2 = workbook.CopyWorksheet(0, 1);   // sheet name could also be set here

Add new worksheet

var sheet3 = workbook.CreateWorksheet();  // sheet name could also be set here
workbook.AddWorksheet(sheet3);

Move worksheet (from position 0 to 3, zero-based number of worksheet)

workbook.MoveWorksheet(0, 3);

Last edited by Jingwood (2014-12-06 06:02:42)

Offline

Board footer

Powered by FluxBB