ByteScout Spreadsheet SDK - C# - Swap Cells and Their Values - ByteScout

ByteScout Spreadsheet SDK – C# – Swap Cells and Their Values

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Swap Cells and Their Values

swap cells and their values in C# and ByteScout Spreadsheet SDK

How To: tutorial on swap cells and their values in C#

On this page you will learn from code samples for programming in C#. ByteScout Spreadsheet SDK was made to help with swap cells and their values in C#. ByteScout Spreadsheet SDK is the SDK that can write and read, modify and calculate Excel and CSV spreadsheets. Most popular formulas are supported. You may import or export data to and from CSV, XML, JSON as well as to and from databases, arrays.

Fast application programming interfaces of ByteScout Spreadsheet SDK for C# plus the instruction and the C# code below will help you quickly learn swap cells and their values. Follow the instruction from the scratch to work and copy and paste code for C# into your editor. Enjoy writing a code with ready-to-use sample C# codes to implement swap cells and their values using ByteScout Spreadsheet SDK.

Trial version can be obtained from our website for free. It includes this and other source code samples for C#.

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

Program.cs
      
using System; using System.Collections.Generic; using System.Text; using Bytescout.Spreadsheet; using System.Diagnostics; using System.IO; namespace Sample { class Program { static void Main(string[] args) { // Open existing Spreadsheets Spreadsheet document1 = new Spreadsheet(); document1.LoadFromFile("input.xls"); // Get first cell value object value1 = document1.Worksheet(0).Cell("A1").Value; // Get another cell value object value2 = document1.Worksheet(0).Cell("B1").Value; // Swap them object value3; value3 = value2; value2 = value1; value1 = value3; document1.Worksheet(0).Cell("A1").Value = value1; document1.Worksheet(0).Cell("B1").Value = value2; // delete output file if exists already if (File.Exists("Output.xls")){ File.Delete("Output.xls"); } // Save document document1.SaveAs("Output.xls"); // Close Spreadsheet document1.Close(); // open generated XLS document in default program Process.Start("Output.xls"); } } }

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

VIDEO

ON-PREMISE VERSION INFORMATION

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

Explore ByteScout Spreadsheet SDK Documentation

Get ByteScout Spreadsheet SDK Free Training

WEB API

Get Your Free API Key

Explore Web API Documentation

Tutorials:

prev
next