public class Name
extends java.lang.Object
Example
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.getWorksheets().get(0);
//Creating a named range
Range range = worksheet.getCells().createRange("B4", "G14");
//Setting the name of the named range
range.setName("TestRange");
//Saving the modified Excel file in default (that is Excel 2000) format
workbook.save("output.xls");
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getComment()
Gets the comment of the name.
|
java.lang.String |
getFullText()
Gets the name full text of the object with the scope setting.
|
java.lang.String |
getR1C1RefersTo()
Gets a R1C1 reference of the
Name. |
Range |
getRange()
Gets the range if this name refers to a range.
|
Range |
getRange(boolean recalculate)
Gets the range if this name refers to a range
|
Range |
getRange(int sheetIndex,
int row,
int column)
Gets the range if this name refers to a range.
|
Range[] |
getRanges()
Gets all ranges referred by this name.
|
Range[] |
getRanges(boolean recalculate)
Gets all ranges referred by this name.
|
ReferredArea[] |
getReferredAreas(boolean recalculate)
Gets all references referred by this name.
|
java.lang.String |
getRefersTo()
Returns or sets the formula that the name is defined to refer to, beginning with an equal sign.
|
java.lang.String |
getRefersTo(boolean isR1C1,
boolean isLocal)
Get the reference of this Name.
|
java.lang.String |
getRefersTo(boolean isR1C1,
boolean isLocal,
int row,
int column)
Get the reference of this Name based on specified cell.
|
int |
getSheetIndex()
Indicates this name belongs to Workbook or Worksheet.
|
java.lang.String |
getText()
Gets the name text of the object.
|
boolean |
isReferred()
Indicates whether this name is referred by other formulas.
|
boolean |
isVisible()
Indicates whether the name is visible.
|
void |
setComment(java.lang.String value)
Sets the comment of the name.
|
void |
setR1C1RefersTo(java.lang.String value)
Sets a R1C1 reference of the
Name. |
void |
setRefersTo(java.lang.String value)
Returns or sets the formula that the name is defined to refer to, beginning with an equal sign.
|
void |
setRefersTo(java.lang.String refersTo,
boolean isR1C1,
boolean isLocal)
Set the reference of this Name.
|
void |
setSheetIndex(int value)
Indicates this name belongs to Workbook or Worksheet.
|
void |
setText(java.lang.String value)
Gets the name text of the object.
|
void |
setVisible(boolean value)
Indicates whether the name is visible.
|
java.lang.String |
toString()
Returns a string represents the current Range object.
|
public java.lang.String getComment()
public void setComment(java.lang.String value)
public java.lang.String getText()
public void setText(java.lang.String value)
public java.lang.String getFullText()
public java.lang.String getRefersTo()
public void setRefersTo(java.lang.String value)
public java.lang.String getR1C1RefersTo()
Name.public void setR1C1RefersTo(java.lang.String value)
Name.public java.lang.String getRefersTo(boolean isR1C1,
boolean isLocal)
isR1C1 - Whether the reference needs to be formatted as R1C1.isLocal - Whether the reference needs to be formatted by locale.public java.lang.String getRefersTo(boolean isR1C1,
boolean isLocal,
int row,
int column)
isR1C1 - Whether the reference needs to be formatted as R1C1.isLocal - Whether the reference needs to be formatted by locale.row - The row index of the cell.column - The column index of the cell.public void setRefersTo(java.lang.String refersTo,
boolean isR1C1,
boolean isLocal)
refersTo - The reference.isR1C1 - Whether the reference is R1C1 format.isLocal - Whether the reference is locale formatted.public boolean isReferred()
public boolean isVisible()
public void setVisible(boolean value)
public int getSheetIndex()
public void setSheetIndex(int value)
public java.lang.String toString()
toString in class java.lang.Objectpublic Range[] getRanges()
public Range[] getRanges(boolean recalculate)
recalculate - whether recalculate it if this name has been calculated before this invocation.public ReferredArea[] getReferredAreas(boolean recalculate)
recalculate - whether recalculate it if this name has been calculated before this invocation.public Range getRange()
public Range getRange(boolean recalculate)
recalculate - whether recalculate it if this name has been calculated before this invocation.public Range getRange(int sheetIndex, int row, int column)
sheetIndex - The according sheet index.row - The according row index.column - The according column indexSee Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.