Documents for Excel, Java Edition Documentation
Features / Worksheet / Range Operations / Hide Rows and Columns
In This Topic
    Hide Rows and Columns
    In This Topic

    You can choose whether to hide or show rows and columns in a worksheet by using the setHidden method of the IRange interface.

    Refer to the following example code in order to hide specific rows and columns in a worksheet.

    Java
    Copy Code
    worksheet.getRange("E1").setValue(1);
    
    // Hide row 2:6 using the setHidden method.
    worksheet.getRange("2:6").setHidden(true);
    
    // Hide column A:D using the sethidden method.
    worksheet.getRange("A:D").setHidden(true);