Method: ExcelWps::Row#cell_name
- Defined in:
- lib/excel_wps.rb
#cell_name(index) ⇒ Object
获得单元格的名字(通过索引)
255 256 257 258 259 260 261 262 263 |
# File 'lib/excel_wps.rb', line 255 def cell_name(index) second = index % 26 first = (index - second) / 26 if first == 0 return @@cell_map[second] + @row_id.to_s end first -= 1 return @@cell_map[first] + @@cell_map[second] + @row_id.to_s end |