Cells.HideColumn

Cells.HideColumn method

Hides a column.

public void HideColumn(int column)
ParameterTypeDescription
columnInt32Column index.

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class CellsMethodHideColumnWithInt32Demo
    {
        public static void Run()
        {
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];
            Cells cells = worksheet.Cells;

            // Set some data in the column we'll hide
            cells["B1"].PutValue("This column will be hidden");
            cells["B2"].PutValue(123.45);

            // Hide column B (index 1)
            cells.HideColumn(1);

            // Unhide the column with standard width
            cells.UnhideColumn(1, cells.StandardWidth);

            // Save the workbook
            workbook.Save("HideColumnDemo.xlsx");
        }
    }
}

See Also