Unfortunately OpenOffice VBA is different to MS Excel's.
In my code using the button you specify the cell within the brackets - in the example Cells(18,2) is B18
Option Explicit
Private Sub CommandButton1_Click()
'use the button to call the macro,specify the cell in the brackets
IncrementCell (Cells(18, 2))
End Sub
The main code takes the cell from the calling code & will increment B18
Option Explicit
Sub IncrementCell(r As Range)
r.Value = r.Value + 1
End Sub
Not sure what changes you need for OpenOffice though
Bookmarks