CellRange as an address?

Posted by: ericlam on 8 September 2017, 3:01 pm EST

  • Posted 8 September 2017, 3:01 pm EST

    In Excel it was possible to get the string address representation from a selection of  2 x 3 cells starting from A1 as "A1:B3".

    Is there an equivalent in Spread.NET?

    Cheers,
    Eric. 


  • Replied 8 September 2017, 3:01 pm EST

    Hello,

    Could you please elaborate on your query further, what steps do you want to perform and what output are you expecting from the same. The selected range in Spread is returned as numerical indexes for the rows and columns using the GetSelection method.  Please provide me with some more information so that I can guide you ahead in the same direction.

    Thanks,

    Manpreet Kaur

  • Replied 8 September 2017, 3:01 pm EST

    Well the A1-style of cell addressing is something most users of Excel are familiar with, so I was hoping to produce that same kind of string for a range selection of multiple cells.

    I'm aware of the GetSelection and GetSelections methods that get the current range selected, but as you say they return numerical indexes - i.e. not in the A1-style. If I got back from that function row index 3 (and row count 4) and column index 2 (and column count 2), then I'd expect something like this as my A1-style range address to output as: "C4:D7"

    I'm sure I could manually convert the numerical indexes to this format myself, but I'm wondering if somewhere in the Spread.NET API there is a function that will do this for me already.

    Cheers,
    Eric. 

  • Replied 8 September 2017, 3:01 pm EST

    Hello,

    You would need to manually convert these numerical indexes that you get using the GetSelection method or GetSelections method to string style addresses as there is no built in function to accomplish the same. Hope it will help you. Please let me know if you have any queries further.

    Thanks,

    Manpreet Kaur

Need extra support?

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

Learn More

Forum Channels