RangeColumns
- class RangeColumns(rng)
Represents the columns of a range. Do not construct this class directly, use
Range.columnsinstead.示例
import xlwings as xw wb = xw.Book("MyFile.xlsx") sheet1 = wb.sheets[0] myrange = sheet1.range('A1:C4') assert len(myrange.columns) == 3 # or myrange.columns.count myrange.columns[0].value = 'a' assert myrange.columns[2] == sheet1.range('C1:C4') assert myrange.columns(2) == sheet1.range('B1:B4') for c in myrange.columns: print(c.address)
Fetch column visibility in xlwings Lite; return
Nonefor a mixed selection.- 返回类型:
bool | None
Whether all represented worksheet columns are hidden.
Setting this property hides or shows the entire worksheet columns represented by the range. Returns
Nonewhen some columns are hidden and others are visible. In xlwings Lite, useawait rng.columns.get_hidden()to read this state.- Setter type:
bool