def autofilter(*args)
      row1, col1, row2, col2 = row_col_notation(args)
      return if [row1, col1, row2, col2].include?(nil)

      # Reverse max and min values if necessary.
      row1, row2 = row2, row1 if row2 < row1
      col1, col2 = col2, col1 if col2 < col1

      @autofilter_area = convert_name_area(row1, col1, row2, col2)
      @autofilter_ref  = xl_range(row1, row2, col1, col2)
      @filter_range    = [col1, col2]
    end
def autofilter(*args)
      row1, col1, row2, col2 = row_col_notation(args)
      return if [row1, col1, row2, col2].include?(nil)

      # Reverse max and min values if necessary.
      row1, row2 = row2, row1 if row2 < row1
      col1, col2 = col2, col1 if col2 < col1

      @autofilter_area = convert_name_area(row1, col1, row2, col2)
      @autofilter_ref  = xl_range(row1, row2, col1, col2)
      @filter_range    = [col1, col2]
    end
:call-seq:
   autofilter(first_row, first_col, last_row, last_col)

 Set the autofilter area in the worksheet.

 This method allows an autofilter to be added to a worksheet.
 An autofilter is a way of adding drop down lists to the headers of a 2D
 range of worksheet data. This is turn allow users to filter the data
 based on simple criteria so that some data is shown and some is hidden.

 To add an autofilter to a worksheet:

     worksheet.autofilter(0, 0, 10, 3)
     worksheet.autofilter('A1:D11')    # Same as above in A1 notation.

 Filter conditions can be applied using the filter_column() or
 filter_column_list() method.

 See the autofilter.rb program in the examples directory of the distro
 for a more detailed example.