p.min = 0 p.max = 100 p.value=0 for i = 0 to 100 p.value = p.value + i ' la progress bar s'incrémente next
For n = 0 To Ubound1 If Fichier1(n, 0) = "" Then Ubound1 = n - 1 End If Next n MaxTableauSource1 = Ubound1
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim Ubound1, Ubound2 As Integer For n = 0 To Ubound1 If Fichier1(n, 0) = "" Then Ubound1 = n - 1 End If Next n For n = 0 To Ubound2 If Fichier2(n, 0) = "" Then Ubound2 = n - 1 End If Next n MaxTableauSource1 = Ubound1 MaxTableauSource2 = Ubound2 ***LA PROGRESSBAR COMMENCE ICI*** n = 0 For i = 0 To MaxTableauSource1 For j = 0 To MaxTableauSource2 If Fichier1(i, 0) = Fichier2(j, 0) Then FichierExiste = True If Fichier1(i, 1) < Fichier2(j, 1) Then n = n + 1 Source2 = "D:\Christine\Rep2" & Fichier2(j, 0) Destination2 = "D:\Christine\Rapport" & Fichier2(j, 0) FileCopy Source2, Destination2 Else n = n + 1 Source1 = "D:\Christine\Rep1" & Fichier1(i, 0) Destination1 = "D:\Christine\Rapport" & Fichier1(i, 0) FileCopy Source1, Destination1 End If End If If Fichier1(i, 0) <> Fichier2(j, 0) Then FichierExiste = False End If If FichierExiste = False Then Source1 = "D:\Christine\Rep1" & Fichier1(i, 0) Destination1 = "D:\Christine\Rapport" & Fichier1(i, 0) FileCopy Source1, Destination1 End If Next j Next i FichierExiste = False For i = 0 To MaxTableauSource2 For j = 0 To MaxTableauSource1 If Fichier2(i, 0) Fichier1(j, 0) Then FichierExiste True Next j If Not FichierExiste Then Source1 = "D:\Christine\Rep2" & Fichier2(i, 0) Destination1 = "D:\Christine\Rapport" & Fichier2(i, 0) FileCopy Source1, Destination1 End If Next I ***ET SE TERMINE LA*** For n = 0 To 100 Flex.AddItem Fichier3(n, 0) & vbTab & Fichier3(n, 1) Next Dim sRepertoire As String sRepertoire = "D:\Christine\Rapport" Set fso = CreateObject("Scripting.FileSystemObject") Set Repertoire = fso.GetFolder(sRepertoire) Flex.Row = 0 Flex.Col = 0 Flex.Text = "Nom du fichier" Flex.Row = 0 Flex.Col = 1 Flex.Text = "Dernière modification" Flex.ColWidth(0) = 2100 Flex.ColWidth(1) = 1700 For Each Fichier In Repertoire.Files Debug.Print Fichier.Name & " " & Fichier.DateLastModified Flex.TextMatrix(Flex.Rows - 1, 0) = Fichier.Name Flex.TextMatrix(Flex.Rows - 1, 1) = Fichier.DateLastModified Flex.Rows = Flex.Rows + 1 Fichier.Copy "D:\Christine\Rep1" Fichier.Copy "D:\Christine\Rep2" Next End Sub