ByteScout Spreadsheet SDK - C# - CopyPaste Columns - ByteScout

ByteScout Spreadsheet SDK – C# – CopyPaste Columns

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – CopyPaste Columns

How to copypaste columns in C# using ByteScout Spreadsheet SDK

This code in C# shows how to copypaste columns with this how to tutorial

Learn how to copypaste columns in C# with this source code sample. ByteScout Spreadsheet SDK: the library (SDK) that is capable of writing, reading, modifying and calculating Excel and CSV spreadsheets. Most popular formulas can be calculated and reculculated with Excel installed. You may import or export data to and from CSV, XML, JSON as well as to and from databases, arrays. It can copypaste columns in C#.

C# code samples for C# developers help to speed up coding of your application when using ByteScout Spreadsheet SDK. Just copy and paste the code into your C# application’s code and follow the instruction. Code testing will allow the function to be tested and work properly with your data.

You can download free trial version of ByteScout Spreadsheet SDK from our website to see and try many others source code samples for C#.

Try ByteScout Spreadsheet SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Text; using Bytescout.Spreadsheet; namespace CopyPasteColumns { class Program { static void Main(string[] args) { // Open spreadsheet from file Spreadsheet document = new Spreadsheet(); document.LoadFromFile(@"example.xls"); //document.LoadFromFile(@"d:\2\1\Bytescout\Spreadsheet SDK\TestCase\Formats.xls"); // Get first worksheet Worksheet worksheet = document.Workbook.Worksheets[0]; // Copy first two ("A-B") columns to the fourth ("D") column worksheet.Columns.CopyAndPaste(0, 1, 12); // Delete output file if exists if (File.Exists("changed.xls")) { File.Delete("changed.xls"); } // Save document document.SaveAs("changed.xls"); // Close spreadsheet document.Close(); // Open generated XLS document in default program Process.Start("changed.xls"); } } }

Try ByteScout Spreadsheet SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)



Get 60 Day Free Trial or Visit ByteScout Spreadsheet SDK Home Page

Explore ByteScout Spreadsheet SDK Documentation

Get ByteScout Spreadsheet SDK Free Training


Get Your Free API Key

Explore Web API Documentation