Method: RubyExcel::Sheet#match

Defined in:
lib/rubyexcel/sheet.rb

#match(header) { ... } ⇒ Fixnum?

Find the row number by looking up a value in a Column

Parameters:

  • header (String)

    the header of the Column to pass to the block

Yields:

  • yields each value in the Column to the block

Returns:

  • (Fixnum, nil)

    the row number of the first match or nil if nothing is found



382
383
384
# File 'lib/rubyexcel/sheet.rb', line 382

def match( header, &block )
  row_id( column_by_header( header ).find( &block ) ) rescue nil
end