# Revision history [back]

### Passing variables from one sub to another Libre Office basic

Hi,

I have found a few related answers but none of them seem to work for me, so I thought I would ask by myself.

I would like to simply pass two string arrays and an integer from one sub to another. To learn how to do that I tried to pass one integer like that:

Sub test
Dim Variable as Integer
Variable = 1
test1(Variable)
End Sub

Sub test1(Variable as Integer)
Print Variable
End Sub


However, when I ran this macro I got an error "Argument is not optional". Does someone know how to fix that?