How to Increase invoice number by one, from Ms excel

how do i get this macro from excel to work in LibreOffice calc.

Rem Attribute VBA_ModuleType=VBAModule
Option VBASupport 1
Private Sub NextInvoice()
Range(“F5”).Value = Range(“F5”).Value + 1
End Sub

Thanks please advise if this is not the place ask?

Switching to LibreOffice

Sub AddOne
    celula = ThisComponent.Sheets.getByName("Plan1").getCellRangeByName("F5")
    celula.Value = celula.Value + 1
End Sub

can you tell me where to add this information thanks I got it :slightly_smiling_face: