Why dont macros work?

All I want is the simple function to use in calc

Function T1(x)
T1 = x
End Function

and I get error 509. So do macros not work at all because if I cant define and us this trivial function than macros a completely useless. Why include them at all if they won’t work? Why does this have to be so frustrating?

Hello,

Yes user functions do work. In your code the issue is with T1. that happens to be the name of a cell already. Change all to T1_test and it has no issue.

Welcome!

Alternatively, a person could use R1C1 syntax via Tools>Options>LibreOffice Calc>Formula>Syntax>ExcelR1C1 :slight_smile: .
Really, I’m just kidding…although that works…I want to address the other part of the question,

Well, unfortunately everything is layer after layer of the historical development of the software–actually of both MS Excel and LO Calc. And people who are already used to it would never even think of naming a macro T1. But of course someone starting out might do just that and be totally baffled and frustrated. So, @russloewe, it’s not your fault…if it were, Ratslinger would have let you know!
That said, programming macros for LO BASIC is difficult programming. If you are just doing math or text manipulation with one-in, one-out things go okay. As soon as you start to spread your wings, frustration will be par for the course for a long time.
So, if you want to do this then follow this mantra: It’s not LO’s fault, it’s not my fault. Blame does no good.
The community is here to help.