Method: Axlsx::Worksheet#name_to_cell

Defined in:
lib/axlsx/workbook/worksheet/worksheet.rb

#name_to_cell(name) ⇒ Cell

returns the column and row index for a named based cell

Parameters:

  • name (String)

    The cell or cell range to return. "A1" will return the first cell of the first row.

Returns:



689
690
691
692
693
694
695
696
697
# File 'lib/axlsx/workbook/worksheet/worksheet.rb', line 689

def name_to_cell(name)
  col_index, row_index = *Axlsx::name_to_indices(name)

  r = rows[row_index]

  if r
    return r[col_index]
  end
end