What does -1 indicate in a range? Example: GC.Spread.Sheets.Range(-1, 0, -1, 1)

Posted by: jeremyfrench on 24 April 2019, 1:18 am EST

  • Posted 24 April 2019, 1:18 am EST

    What does "-1" indicate in a range?

    That is, the "-1" that appears for row number and row count:

    GC.Spread.Sheets.Range(-1, 0, -1, 1)

    For example, I can create a filter to the first 10 columns with:

    activeSheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(-1, 0, -1, 10)));

    So what do the minus ones indicate?

    Range(-1, 0, -1, 10)


    When I look at the documentation for range, I don't see anything about the meaning of a "-1" argument for row number and row count.

  • Replied 24 April 2019, 8:55 pm EST


    Sorry for all the confusion.
    If the row is -1 and rowCount is -1, then the range represents columns. Similarly, if the col is -1 and colCount is -1, the range represents rows.
    For example, range (-1,4,-1,6) represents the columns "E:J" and range (4,-1,6,-1) represents the rows "5:10".

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels