made it! there were some counter errors too i guess.
Code:
Public Function CreaFileOCF(Nome As String, Cognome As String) Dim xlx As Object, xlw As Object, xls As Object, xlc As Object
Dim Arr() As String
Dim Arr2() As String
Dim Counter As Long
Dim Counter2 As Long
Dim Col As Long
Dim Rw As Long
Counter = 0
Counter2 = 0
Col = 0
Rw = 0
On Error Resume Next
Set xlx = GetObject(, "Excel.application")
If Err.Number <> 0 Then
Set xlx = CreateObject("Excel.application")
End If
Err.Clear
On Error GoTo 0
xlx.Visible = False ' se setto vero mi apre il file excel in questione
Workbooks.Add
ActiveWorkbook.SaveAs "C:\Users\diego\OneDrive - Indipendente\Lavoro\HH\Candidati\Z-Aggiornamenti ocf\" & Nome & "-" & Cognome
Set xlw = xlx.Workbooks.Open("C:\Users\diego\OneDrive - Indipendente\Lavoro\HH\Candidati\Z-Aggiornamenti ocf\" & Nome & "-" & Cognome)
Set xls = xlw.worksheets(1)
Set xlc = xls.Range("a1")
Arr = Split(Paste_from_Clipboard, Chr(10))
For Counter = LBound(Arr) To UBound(Arr)
Debug.Print (Replace(Arr(Counter), Chr(13), ""))
Arr2 = Split(Replace(Arr(Counter), Chr(13), ""), Chr(9))
For Counter2 = LBound(Arr2) To UBound(Arr2)
Debug.Print (Arr2(Counter2))
xlc.Offset(Rw, Col).Value = Arr2(Counter2)
Col = Col + 1
Next
Col = 0
Rw = Rw + 1
Next
xlw.Save
xlw.Close
Set xlc = Nothing
Set xls = Nothing
Set xlw = Nothing
xlx.Quit ' se esiste l'applicazione excel la chiude
Set xlx = Nothing
End Function