I guess I’m sorry (?) for asking something that I thought was clear. Since people seemed to not like how in-experienced I was I assumed people would not care for the AI slop solution.
Let’s go over this in more detail
Explainer on what I’m doing:
I don’t think I’m using this program in it’s classical “intended” way. I’m simply using it as a visual way to display the EAN codes of products on shelves in a warehouse. The whole “table” of cells is always visible and all that’s gonna be done is that up to 4 lines of numbers will be stored in each cell for me to Ctrl + F my way to. It’s just to track where I put everything more effectively. I’m not doing any actual calculations or such.
Why no ods:
I didn’t upload the ods because the sheet is in Swedish and I simply didn’t wanna have to go through the trouble of translating it to English to upload here. I thought (wrongly) that it would just be an easy copy/paste when some pro drops the seemingly simple macro. I guess in the end my ask really was to abstract for a forum about calc. I’ll drop the ods though I won’t translate it cause the text really doesn’t matter for understanding the problem and solution in the end. Just didn’t wanna confuse people but no ods seems to have been more confusing.
Jobbet test.ods (35.2 KB)
I expected an answer with a copy/paste macro solution but I got way more than I could chew. I did see Shiavinatto’s answer and was gonna try but then I noticed mine worked and decided on good enough. The rest I could not begin to think about how to interpret/test… mb?
Oh and I skipped on have the numbers be invisible cause it didn’t work with the macro and wasn’t fully necessary in the end. Though I’d love suggestions. But the cell must auto-update with the active cell since I want it to work with the auto-select from a Ctrrl + F search.
Seeing as some are keen on knowing the solution I’m gonna post the macro that ended up working all along below incase you don’t wanna check the ods.
Sub ShowActiveCell(oEvent)
oSheet = ThisComponent.CurrentController.ActiveSheet
'Replace "A1" with your target cell address
oTargetCell = oSheet.getCellRangeByName("A1")
oActiveCell = ThisComponent.getCurrentSelection()
If oActiveCell.supportsService("com.sun.star.sheet.SheetCell") Then
oTargetCell.String = oActiveCell.String
End If
End Sub
Solution: If it’s not the traditional way to use a program, use AI and through some trial and error you’ll get there 