Skip to main content

Module edit

Module edit 

Source
Expand description

Inserting and removing rows and columns, and what that does to the rest of the workbook.

A reference the edit deletes outright becomes #REF!, as it does in Excel; one that merely loses part of a range is narrowed instead. $ does not protect a reference here: an absolute address names a cell, and inserting a row above that cell moves the cell.

Structs§

Deduplicated
What remove_duplicates did.
FlashFill
A way of making an output from the cells left of it, learnt from examples.
OutlineGroup
One group of an outline: lines first..=last, 0-based, at level.
PivotCaptions
The words a report is laid out with. {} in a template stands for the field or item name. Default is what an English Excel writes; the caller passes another language, which this crate does not know.
SortKey
One key of sort_range: what to compare and in which direction.
SortOptions
How sort_range_with reads its range.
Subtotals
How subtotal summarises a list.

Enums§

Axis
Which way the grid is being edited.
CopyOrigin
Where inserted rows or columns take their formatting from: Excel’s CopyOrigin on Range.Insert.
FilterOutput
Where advanced_filter puts what passes.
SortBy
What a SortKey compares.
SplitBy
How text_to_columns cuts a cell’s text.
SubtotalFunction
What a subtotal row computes: the eleven aggregates of SUBTOTAL.

Constants§

MAX_OUTLINE_LEVEL
The deepest outline Excel keeps: eight level buttons, seven levels of groups.

Functions§

advanced_filter
Filters a list by a criteria range: Excel’s Data - Advanced.
collapse_columns
collapse_rows for columns.
collapse_rows
Hides the detail of a group: Data - Hide Detail, or the outline’s minus button. row names the group as the button does: the group whose summary row it is, or else the innermost group it is in. Returns whether there was such a group.
column_groups
The groups of a sheet’s columns, outer ones first.
consolidate
Combines ranges into one table: Excel’s Data - Consolidate, without links to the sources.
copy_range
Copies a rectangle of cells, formatting and all, so that its top left corner lands on to.
expand_columns
expand_rows for columns.
expand_rows
Shows the detail of a group again: Data - Show Detail, or the plus button. Groups inside it that were collapsed on their own stay so.
fill
Copies the first row of area into every row below it (Axis::Rows, Excel’s Ctrl+D), or its first column into every column to the right (Axis::Columns, Ctrl+R). Values, formatting and formulas go as copy_range takes them: a relative reference moves with each copy.
fill_series
Fills area the way dragging the fill handle does: down each column for Axis::Rows, right along each row for Axis::Columns.
fill_series_back
fill_series the other way: the fill handle dragged up (Axis::Rows) or left (Axis::Columns). The seed is the run of filled cells at the end of the area, and the series runs back from it: 1, 2 above goes 0, -1, a single Кв3 goes Кв2, Кв1, a single date steps back a day.
filter_table
Sets what one column of a table keeps, then hides the data rows that the table’s criteria reject and shows the rest, as applying a filter in Excel does. column counts from 0 at the table’s first column; None takes the column’s criterion off. The table is found by name anywhere in the book.
flash_fill
Fills the empty cells of at’s column by example: Excel’s Data - Flash Fill (Ctrl+E), run with at in the column to fill.
group_columns
group_rows for columns.
group_rows
Groups rows first..=last one level deeper: Data - Group. Rows already grouped become a group inside their group.
insert_cells
Inserts blank cells over area, pushing what was there down or right.
insert_cells_with
insert_cells, with the new cells styled like the line beside them: above or to the left for Before, below or to the right for After.
insert_columns
Inserts count columns before column at, 0-based.
insert_columns_many
insert_rows_many for columns: the result of insert_columns_with called once per place from right to left.
insert_columns_with
insert_columns, with the new columns formatted like a neighbour: cell styles, the column’s own style and its width.
insert_rows
Inserts count rows before row at, 0-based. Everything from there down moves, and every reference to it follows.
insert_rows_many
Inserts rows at several places in one pass over the workbook: each (at, count) puts count rows before row at, 0-based.
insert_rows_with
insert_rows, with the new rows formatted like a neighbour: cell styles, the row’s own style and its height.
move_range
Moves a rectangle of cells so that its top left corner lands on to, leaving the source empty.
move_sheet
Moves the sheet at from to position to in the tab bar.
refresh_all_pivots
Refreshes every pivot table of the workbook, as Excel’s Refresh All does, and returns how many were laid out.
refresh_pivot
Lays out pivot table table of sheet sheet from its source data, and returns the cells the report now covers.
remove_cells
Removes the cells of area, pulling what was below or to the right of them back over the hole.
remove_columns
Removes count columns starting at column at, 0-based.
remove_columns_many
remove_rows_many for columns: the result of remove_columns called once per block from right to left, with overlapping blocks merged.
remove_duplicates
Removes the rows of area that repeat a row above them: Excel’s Data - Remove Duplicates.
remove_rows
Removes count rows starting at row at, 0-based.
remove_rows_many
Removes several blocks of rows in one pass over the workbook: each (at, count) names count rows from row at, 0-based.
remove_sheet
Removes the sheet at sheet, turning every reference into it into #REF!.
rename_sheet
Renames the sheet at sheet, rewriting every formula that names it.
row_groups
The groups of a sheet’s rows, outer ones first.
show_outline_level
The outline’s level buttons: shows rows, columns or both down to outline level n, where 1 shows only the outermost summaries and MAX_OUTLINE_LEVEL + 1 shows everything. None leaves that side alone.
sort_range
Sorts the rows of area by keys, the first key deciding first: Excel’s Data - Sort on a range with no header row. sort_range_with takes a header row and sorts columns.
sort_range_with
Sorts the rows (or columns) of area by keys, the first key deciding first.
sort_table
Sorts the data rows of the table called name - its header and totals rows stay put - with keys naming its columns by SortBy::Header or by sheet column.
subtotal
Adds a total row under each group of a sorted list and a grand total under all of them, and outlines the result: Excel’s Data - Subtotal with “Summary below data”.
text_to_columns
Splits the text of each cell in the first column of source across the columns from destination rightwards: Excel’s Data - Text to Columns, with every column in the General format.
ungroup_columns
ungroup_rows for columns.
ungroup_rows
Takes rows first..=last one level out of their outline: Data - Ungroup. A row that leaves the outline altogether is shown again.

Type Aliases§

ConsolidateSource
One source of consolidate: a sheet and a range on it.