Document Solutions for Excel, .NET Edition | Document Solutions
Features / Table / Convert Table to Range
In This Topic
    Convert Table to Range
    In This Topic

    While a range refers to a group of cells, a table is nothing but a dynamic range of cells that is pre-formatted and organized. Just like converting a range into a table, you can also convert a table into a range. This feature is helpful when you want to use features such as dynamic arrays, which are not supported inside a table but, you want to have a table like formatting.

    To handle such cases, DsExcel.Net provides ConvertToRange() method of the ITable interface to convert table into a range of cells without losing the table style. Converting table into a range of cells retains the cell data, table formatting and formulas but removes the table functionality. Note that on converting a table into a range, table reference used in formulas or Defind Names are converted to cell reference.

    Refer to the following example code to convert table into range of cells in DsExcel.NET:

    C#
    Copy Code
     // Add table
     ITable table = worksheet.Tables.Add(worksheet.Range["A9:D13"], true);
    
     // Convert table to range
     table.ConvertToRange();