Hi,
Is it possible that when Job end, fusion pro take a macro on a excel data and restart to print variable date the result of a macro .
I attach the macro that i have on a excel and that write on sheet 2.
Now i create a file for fusion pro for print variable data and after i create another file from sheet 2 for print the variable data from result to macro.
Sub Estrai()
Dim Coll As New Collection
Dim uRiga As Long
Dim Righe As String
Dim Matrix As Variant
Dim Arr
Dim i As Integer
Dim y As Integer
'determina l'ultima riga
uRiga = Foglio1.Range("A" & Rows.Count).End(xlUp).Row
'carica la tabella in matrice
Matrix = Foglio1.Range("A1:L" & uRiga)
'esculde i duplicati
On Error Resume Next
For i = 2 To uRiga
Coll.Add i, CStr(Foglio1.Cells(i, 12) & Foglio1.Cells(i, 1) & Foglio1.Cells(i, 2))
Next
On Error GoTo 0
'genera matrice con le righe univoche
For i = 1 To Coll.Count
Righe = Righe & " " & Coll(i)
Next
Righe = Trim(Righe)
'estrae dalla matrice principale una matrice filtrata senza duplicati
Arr = Application.Index(Matrix, Application.Transpose(Split(Righe)), Array(12, 1, 2, 10))
'azzera il 4^ campo della matrice
For i = 1 To UBound(Arr)
Arr(i, 4) = 0
Next
'somma nel 1^ campo della matrice ogni dato univoco
For i = 1 To UBound(Arr)
For y = 1 To UBound(Matrix)
If Arr(i, 1) = Matrix(y, 12) And Arr(i, 2) = Matrix(y, 1) And Arr(i, 3) = Matrix(y, 2) Then
Arr(i, 4) = Arr(i, 4) + Matrix(y, 10)
End If
Next y
Next i
'scrive le intestazioni
Foglio2.Range("A1") = "Ciao"
Foglio2.Range("B1") = "come"
Foglio2.Range("C1") = "stai"
Foglio2.Range("D1") = "ok"
'scrive la matrice su foglio
Foglio2.Range("A2").Resize(UBound(Arr), 4) = Arr
End Sub
Thank you