I have a libre calc spread sheet where each cell in column A has a button. Currently the buttons are anchored to their respective cells. When the button is pressed it runs a macro that uses data from the Cell to the right of it.
Ex: Button in cell A1, when pressed it calls a macro and uses the text in cell B1.
Ex: Button in cell A2, when pressed it calls a macro and uses the text in cell B2.
Both above examples are working now, but I have to hard code the label of each button in my code for my macros to properly reference which button was pressed.
I can see me expanding this to dozens of rows if not hundreds. Is there a way I can make a “Generic” button with no label and anchor it to a cell say A3, and when I press it I can then find out which cell the button is anchored to without knowing anything else about the button? Like a function that returns the last used button. i.e. ThisButton or something. I don’t know how to drill down from ThisComponent to get the info I seek but I assume this is the way to go.
If this was to work I would then want to copy the button in cell A3 and paste a new copy into cell A4. This new button in A4 when pressed would know to use text in B4 when pressed.
Greatly appreciate the help!