We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Copy rows from 1 sheet to another

Thread ID:

Created:

Updated:

Platform:

Replies:

144614 May 14,2019 03:05 PM UTC May 15,2019 11:29 AM UTC WinForms 1
loading
Tags: XlsIO
Paul Meems
Asked On May 14, 2019 03:05 PM UTC

I'm trying to merge several Excel files into 1 cleanup file.

I have this code:

        private void ProcessWorksheet(IWorksheet worksheet)
        {
            worksheet.UsedRangeIncludesFormatting = false;
            var range = worksheet.UsedRange;
            var migrantRange = worksheet.MigrantRange;
            var regex = new Regex(@"\d{8,9}");
            for (var i = 0; i < range.LastRow; i++)
            {
                migrantRange.ResetRowColumn(i, 1);
                if (migrantRange.HasNumber && regex.Match(migrantRange.Number.ToString(CultureInfo.InvariantCulture)).Success)
                {
                    // Correct row
                    Debug.WriteLine(migrantRange.Number);
                    --> How to copy complete row to new sheet called _workSheetResult
                }
            }
        }

I know when I have the row I need to copy, but how do I copy a whole row or range?
Do I need to do it cell by cell?

Sivaneswaran Amsu [Syncfusion]
Replied On May 15, 2019 11:29 AM UTC

Hi Paul, 

Thank you for contacting Syncfusion support. 

We have shared the sample for copy from range one worksheet to another worksheet which can be downloaded from the following link. 


To know more about the copy option please refer the following UG documentation link. 



Please let us know if this helpful for your requirement. 


Regards, 
Sivaneswaran . A

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon