What are the limitations of macros in LibreOffice Calc?

I’ve been trying to copy text from two cells to a third [first name + last name to “display name”]. When I do the command sequence manually it works fine but when I record a macro it merely copies from a previous line done manually. My keystroke sequence is: move to the pertinent “last name” cell with the directional keys, copy the cell contents, move to the target cell, enter F2 to edit, paste the last name, add a comma and a space, move with the directional keys to the appropriate “first name” cell, copy the contents from that cell, move to the target cell with the directional keys, enter F2 to edit, paste the first name, press RETURN to the next row.

Recording macros can sometimes be usefull to find the commands needed but often they need to be edited afterwards to make them usefull. It’s usually better to write the macro in Basic.

Are you sure you want a macro to do this? If you give the column number for first name and last name and you want the display name in the selected cell then I’ll post an example.

An alternate would be to use a formula in the target cell, for example:-

=$B2 & ", " & $A2

Then this cell formula can be copied and pasted down the column.

If you then want to keep the display name without the formula you could copy that column and paste special back to itself as values only.

THANK YOU for the perfect solution. I hadn’t realized (or I forgot) that cell formulae could include text strings.