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:

Hi,
I’m totally new in macro and have been looking for 2 days for a macro and i have no idea how to write this in Libre Office.
Hope someone can help.
i Have a sheet call Facture and the cell for the invoice# is B9.
I’m looking for a macro to clear cell C7:C8 and at the same time increase the invoice # for the next invoice.
Thanks in advance :slight_smile:

Hi,

I trust this refcard
LibOBasic_03_Calc_Flat_A4_EN_v200.pdf (139.6 KB)
might help.

Thank you :slight_smile: