zaz/doc/source/main/examples_calc.rst

48 lines
745 B
ReStructuredText
Raw Normal View History

2021-06-03 17:47:12 -05:00
2021-06-03 22:09:34 -05:00
For Calc
--------
2021-06-03 17:47:12 -05:00
2021-06-03 22:09:34 -05:00
Data to cell
^^^^^^^^^^^^
Automatic calculate size range.
2021-06-03 17:47:12 -05:00
.. code-block:: python
2021-06-03 22:09:34 -05:00
def calc_data_to_cell():
sheet = app.active_sheet
data = (
('Month', 'Total'),
('January', 100),
('February', 200),
('March', 300),
('April', 400),
('May', 500),
)
sheet['A1'].data = data
2021-06-03 17:47:12 -05:00
return
2021-07-07 22:45:43 -05:00
Copy visible cells
^^^^^^^^^^^^^^^^^^
.. code-block:: python
doc = app.active
rangos = doc.active['A1'].current_region.visible
doc.select(rangos)
doc.copy()
doc.active['A15'].select()
doc.paste()
2021-07-11 22:31:59 -05:00
Merge by row
^^^^^^^^^^^^
.. code-block:: python
rango = app.selection
rango.merge_by_row()