We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to delete a range in aspose cells java

I was able to find documentation for .net but i dont see any api for aspose cells java. can you please let me know how to delete a named range using aspose cells.

thanks.

Hi,

Thanks for your posting and using Aspose.Cells for Java.

Please download and use the latest version:
Aspose.Cells for Java (Latest Version)

To delete the named range please use one of the following methods.


workbook.getWorksheets().getNames().remove(string arg0)

workbook.getWorksheets().getNames().remove(string[] arg0)

workbook.getWorksheets().getNames().removeAt(int arg0)



Does this delete the rows in that range as well? If it does not, how do I accomplish that? Thanks.

Hi,

The above methods actually remove the named range from name manager.

Please see the screenshot below.

If you want to delete the Range including its columns and rows, then please use the


worksheet.getCells().deleteRange(arg0, arg1, arg2, arg3, arg4);

Screenshot:

can you please give me an example of how to use it.

deleteRange(intstartRow, intstartColumn, intendRow, intendColumn, intshiftType)

Thanks.

Hi,

Please see the following code example.

Java


//Delete all cells starting in a range “A1:B100”

worksheet.getCells().deleteRange(0, 0, 1, 100, ShiftType.UP);