Doc for ranges

This commit is contained in:
El Mau 2022-03-15 22:02:26 -06:00
parent 5e73b560d4
commit e41ac71b2f
2 changed files with 124 additions and 1 deletions

123
docs/source/calc_ranges.rst Normal file
View File

@ -0,0 +1,123 @@
Ranges
------
By selection
^^^^^^^^^^^^
.. code-block:: python
doc = app.active
selection = doc.selection
app.debug(selection)
Count
^^^^^
.. code-block:: python
selection = doc.selection
count = len(selection)
app.debug(count)
Iter
^^^^
.. code-block:: python
selection = doc.selection
for rango in selection:
app.debug(rango)
Get
^^^
* By index
.. code-block:: python
selection = doc.selection
rango = selection[1]
app.debug(rango)
* By name
.. code-block:: python
selection = doc.selection
rango = selection['Sheet1.D9:E11']
app.debug(rango)
New ranges container
^^^^^^^^^^^^^^^^^^^^
.. code-block:: python
ranges = doc.ranges
Add
^^^
.. code-block:: python
doc = app.active
sheet = doc.active
rangos = doc.ranges
rangos.add(sheet['A1:B2'])
rangos.add(sheet['D5:F10'])
app.debug(rangos)
Remove
^^^^^^
.. code-block:: python
rangos.remove(sheet['A1:B2'])
If contains
^^^^^^^^^^^
.. code-block:: python
result = sheet['D5:F10'] in rangos
app.debug(result)
Get same range in all sheets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: python
rangos = doc.get_ranges('A1:C5')
app.debug(rangos)
Names
^^^^^
.. code-block:: python
app.debug(rangos.names)
Get and set data
^^^^^^^^^^^^^^^^
.. note::
Each range of data must be the exact size of each range.
.. code-block:: python
rangos = doc.get_ranges('A1:C5')
data = rangos.data
app.debug(data)
rangos.data = data
Style
^^^^^
Apply the same style to all ranges.
.. code-block:: python
rangos = doc.get_ranges('A1:C5')
rangos.style = 'Good'

View File

@ -65,7 +65,7 @@ Count
|
Iter
----
^^^^
.. code-block:: python