You are here Create UDF function return array with resize Join data from multiple files with JoinFile in ATools

Join data from multiple files with JoinFile in ATools

The lecture provides detailed instructions on VBA programming to merge Excel files showing the merging status of each file very professionally with the JoinFiles API function of Add-in A-Tools.

 
 
'------------------------------------------------------------------------------------------------------------
Sub TestJoinFiles()
 
    Dim x, t1
    t1 = getTickCount
    x = JoinFiles(Range("C3").Value, Range("A4:A1003").Value, True, _
                  ObjPtr(ActiveCell), AddressOf DoProgress)
    MsgBox "Thoi gian thuc hien: " & (getTickCount - t1) / 1000 & " giay" & vbNewLine & _
            "So dong ghep duoc: " & x, vbInformation
End Sub
'------------------------------------------------------------------------------------------------------------
Sub DoProgress(ByVal Value As Long, ByVal MaxValue As Long, _
                ByVal sSQL As String, ByVal sFile As String)
    UserForm1.BSProgressBar1.Max = MaxValue
    UserForm1.BSProgressBar1.Position = Value
    UserForm1.Label1.Caption = Round(Value / MaxValue * 100, 0) & "%"
    UserForm1.Label2.Caption = sSQL
    UserForm1.Label3.Caption = sFile
    DoEvents
 End Sub