I am totally new in this forum and I have a problem ..
I have created a VBA code for MS Excel and when I send it to a friend he told me that he is using OpenOffice
This is the code
Code: Select all
Sub Test()
Dim fi As Integer
Dim fo As Integer
Dim si As String
Dim ai() As String
Dim i As Long
fi = FreeFile
Open "Sample.txt" For Input As #fi
fo = FreeFile
Open "Output.txt" For Output As #fo
Do While Not EOF(fi)
Line Input #fi, si
ai = Split(si)
If UBound(ai) Mod 2 = 0 Then
ReDim Preserve ai(UBound(ai) + 1)
End If
For i = 0 To UBound(ai) Step 2
Print #fo, ai(i) & " " & ai(i + 1)
Next i
Loop
Close #fi
Close #fo
End Sub
Is it possible to convert it to work in OpenOffice?
If possible please give me the steps in details
Thanks advanced for help