cfsimplicity / spreadsheet-cfml

Standalone library for working with spreadsheets and CSV in CFML
MIT License
127 stars 36 forks source link

getCellAddress return fixed column or fixed row #367

Open sebviatour-iteamlu opened 5 months ago

sebviatour-iteamlu commented 5 months ago

Hello,

I'm using the new function getCellAddress but is it possible to specify if the selected row or the selected column is fixed ?

ex : $D2 or D$2 or $D$2.

Is it also possible to specify the Sheet ?

Thanks for your feedback.

Best Regards,

Sébastien

cfsimplicity commented 5 months ago

Hi Sébastien

I'm not sure I understand what you're asking for. Absolute references using $ signs are generally for formulas as I understand it. They're not a property of the cell location, which is what getCellAddress() returns.

Can you give me a concrete, detailed example of what you would like the library to do?

Thanks.

cfsimplicity commented 5 months ago

Is it also possible to specify the Sheet ?

Just change the active sheet to the one you want before calling the method.

sebviatour-iteamlu commented 5 months ago

Hi Julian,

For the first point, I'm asking because I using the new function getCellAddress and I would like to know if it's possible to have in optional the absolute references as you mentionned.

It could be useful.

For the second comment, I'm asking if it's possible with the same function to take a field from an other sheet that the active one.

Is it more clear for you ?

cfsimplicity commented 5 months ago

Is it more clear for you ?

Not really. I don't see how absolute references are relevant here. The purpose of getCellAddress() is to return the string reference of a cell identified by the row/column number. Absolute references using $ are for when you are referencing cells by a string (e.g. in a formula), not by column/row number.

If you want to use the result of getCellAddress() as an absolute reference then you can add $ signs to that if you want.

Perhaps I'm misunderstanding, but in that case please provide a concrete example with the input and output you want to see?

For the second comment, I'm asking if it's possible with the same function to take a field from an other sheet that the active one.

Yes, as I said, just change the active sheet to the one you want it to operate on using https://github.com/cfsimplicity/spreadsheet-cfml/wiki/setActiveSheet You can change the active sheet back again if you need to.