帮助中心

# ExcelRange类型

# 简介

ExcelRange模块提供对于Excel中区域的的操作功能, 例如对于区域进行筛选, 排序, 自动填充等功能

# 函数概览

函数名称 描述
appendPaste (opens new window) 调用appendPaste函数,在ExcelRange对象中追加粘贴数据。
appendWrite (opens new window) 调用appendWrite函数向当前区域追加写入内容。
autoFilter (opens new window) 调用autoFilter函数在指定Excel工作表区域设置筛选选项。
autofill (opens new window) 调用autofill函数将当前区域的值、格式等向外填充
clear (opens new window) 调用clear函数清除区域内容。
clearContext (opens new window) 调用clearContext函数清除区域中单元格的公式和值,会保留单元格格式和条件格式。
clearRnageBorder (opens new window) 调用clearRnageBorder函数清除选定区域的边框。
copy (opens new window) 调用copy函数复制选定Excel工作表区域。
delete (opens new window) 调用delete函数删除ExcelRange区域对象。
getAddress (opens new window) 调用getAddress函数获取ExcelRange区域对象的坐标位置。
getAlign (opens new window) 调用getAlign函数获取指定Excel区域的水平对齐方式。
getBackgroundColor (opens new window) 调用getBackgroundColor函数获取区域的背景颜色。
getBeginPos (opens new window) 调用getBeginPos函数获取该区域起始(左上角)单元格位置。
getBorder (opens new window) 调用getBorder函数获取当前Excel区域实例的边框。
getBorders (opens new window) 调用getBorders函数获取当前ExcelRange实例的所有边框类型。
getBriefInfo (opens new window) 调用getBriefInfo函数获取当前Excel区域实例的简要信息文本。
getColCount (opens new window) 调用getColCount函数获取指定Excel区域内列数量。
getColumnByHeader (opens new window) 调用getColumnByHeader函数按照列名(表头)获取列对象。
getColumnByRealIndex (opens new window) 调用getColumnByRealIndex函数按照该列在区域内的索引获取列。
getColumnList (opens new window) 调用getColumnList函数获取列对象列表。
getEndPos (opens new window) 调用getEndPos函数获取该区域结束(右下)单元格坐标。
getFirstColumnIndex (opens new window) 调用getFirstColumnIndex函数获取区域内第一列在工作表内的索引。
getFirstColumnLabel (opens new window) 调用getFirstColumnLabel函数获取区域对象第一列的列标签。
getFirstRowIndex (opens new window) 调用getFirstRowIndex函数获取区域对象第一行在工作表中的索引。
getFont (opens new window) 调用getFont函数获取区域对象的字体。
getHeaderCell (opens new window) 调用getHeaderCell函数根据表头获取单元格。
getHeaderList (opens new window) 调用getHeaderList函数获取表头列表。
getHeaderPos (opens new window) 获取表头单元格的坐标, 与ExcelRange.getHeaderCell类似
getHeight (opens new window) 调用getHeight函数获取指定Excel工作表区域的行高。
getLastColumnIndex (opens new window) 调用getLastColumnIndex函数获取该区域最后一列的索引。
getLastColumnLabel (opens new window) 调用getLastColumnLabel函数获取该区域最后一列的列标签。
getLastRowIndex (opens new window) 调用getLastRowIndex函数获取区域最后一行索引。
getNextColIndex (opens new window) 调用getNextColIndex函数获取当前区域最后一列的下一列在工作表(Sheet)中的索引。
getNextColLabel (opens new window) 调用getNextColLabel函数获取指定Excel工作表区域下一列列标签。
getNextRowIndex (opens new window) 调用getNextRowIndex函数在当前工作区域中获取下一行的行索引信息。
getNumberFormat (opens new window) 调用getNumberFormat函数获取当前区域数值格式代码。
getNumberFormatLocal (opens new window) 调用getNumberFormatLocal函数获取用户当前语言环境的数值格式代码。
getRealColIndexByColLabel (opens new window) 调用getRealColIndexByColLabel函数按列标签获取该列在该区域内的索引。
getRowByRealIndex (opens new window) 调用getRowByRealIndex函数根据区域中的索引获取行。
getRowCount (opens new window) 调用getRowCount函数获取ExcelRange区域行数量。
getRowList (opens new window) 调用getRowList函数获取ExcelRange区域中的行对象列表。
getTypeName (opens new window) 调用getTypeName函数获取当前ExcelRange实例的数据类型名称文本。
getValue (opens new window) 调用getValue函数获取ExcelRange区域中的值, 并将单元格内的值以DataTable的形式返回。
getWidth (opens new window) 调用getWidth函数获取ExcelRange区域内的列宽(Size对象)。
hasHeader (opens new window) 调用hasHeader函数判断该区域是否存在表头(列名)。
isMerge (opens new window) 调用isMerge函数判断该区域中是否有合并的单元格。
isNull (opens new window) 调用isNull函数判断当前Excel区域实例是否为空对象。
merge (opens new window) 调用merge函数将目标Excel工作表区域合并为一个单元格。
paste (opens new window) 调用paste函数对复制的Excel区域对象进行粘贴操作。
select (opens new window) 调用select函数选择Excel当前区域。
setAlign (opens new window) 调用setAlign函数设置Excel当前区域水平对齐方式。
setBackgroundColor (opens new window) 调用setBackgroundColor函数设置该区域的背景颜色(需要传入Color对象)。
setBorder (opens new window) 调用setBorder函数设置Excel区域边框(某个方向的局部边框)。
setBorders (opens new window) 调用setBorders函数设置工作簿的工作表中选定区域的边框。
setFont (opens new window) 调用setFont函数设置指定Excel工作表中单元格文本字体。
setHasHeader (opens new window) 调用setHasHeader函数设置当前区域是否有列名(表头)
setHeight (opens new window) 调用setHeight函数设置Excel区域内的行高。
setNumberFormat (opens new window) 调用setNumberFormat函数设置当前区域的数值格式。
setNumberFormatLocal (opens new window) 调用setNumberFormatLocal函数使用本地语言设置当前区域的数值格式。
setRangeBorder (opens new window) 调用setRangeBorder函数设置区域对象的边框。
setWidth (opens new window) 调用setWidth函数设置区域内列宽。
sort (opens new window) 调用sort函数将指定Excel工作表区域按规则排序。
sortSpecial (opens new window) 调用sort函数将指定Excel工作表区域按规则排序。
toCommonDataTable (opens new window) 调用toCommonDataTable函数将Excel文件工作表内获取到的指定区域转换为数据表(DataTable)类型。
toCommonDataTableWithFormat (opens new window) 调用toCommonDataTableWithFormat函数将Excel文件工作表内获取到的指定区域转换转换为带有类型的数据表。
toDataTable (opens new window) 调用toDataTable函数截取当前区域并转换为数据表。
toHtml (opens new window) 调用toHtml函数将ExcelRange对象转换为HTML文本。
toString (opens new window) 调用toString函数获取当前ExcelRange实例转换为文本的结果。
getVAlign (opens new window) 调用getVAlign函数获取Excel工作表区域垂直对齐方式。
setVAlign (opens new window) 调用setVAlign函数为指定Excel工作表区域设置垂直对齐方式。
getSheet (opens new window) 调用getSheet函数获取指定ExcelRange对象所在的工作表。
unMerge (opens new window) 调用unMerge函数取消指定Excel区域的合并单元格。
isEmpty (opens new window) 调用isEmpty函数,返回Excel中区域是否为空。
getViewValue (opens new window) 调用getViewValue函数获取区域中的可见文本, 会将单元格内的值以字符串类型组成DataTable的形式返回, 空单元格的值为空字符串。
find (opens new window) 调用find函数在区域(Range)内查找符合条件的单元格。
findNext (opens new window) 调用findNext函数查找传入单元格后的第一个匹配的单元格。
findPrevious (opens new window) 调用findPrevious函数查找传入单元格前的第一个匹配的单元格。
findList (opens new window) 调用findList函数在区域内查找符合条件的单元格。
replace (opens new window) 调用函数replace在区域内查找替换符合条件的内容。
mergeArea (opens new window) 调用mergeArea函数获取合并单元格所在的区域。
autoFitWidth (opens new window) 调用autoFitWidth函数自动调整Excel区域列宽。
autoFitHeight (opens new window) 调用autoFitHeight函数自动调整Excel区域行高。
toDataFrame (opens new window) 调用toDataFrame函数读取Excel区域为增强数据表。
exportAsFixedFormat (opens new window) 调用exportAsFixedFormat函数将Excel工作表区域导出为固定格式文件。
removeDuplicates (opens new window) 调用removeDuplicates函数删除指定Excel区域重复项。
toCommonDataTableWithoutHiddenCells (opens new window) 调用toCommonDataTableWithoutHiddenCells函数读取指定Excel区域为数据表。
sortByOrderConditions (opens new window) 调用sortByOrderConditions函数对指定Excel区域进行排序。
getRowListWithOptions (opens new window) 调用getRowListWithOptions函数获取Excel行列表。
getValueWithZone (opens new window) 调用getValueWithZone函数获取Excel区域对象内单元格的值。
toCommonDataTableWithoutHiddenCellsWithZone (opens new window) 调用toCommonDataTableWithoutHiddenCellsWithZone函数获取非隐藏区域中单元格的值。
最近更新时间: { "value": "2023-09-12", "effect": true }