....
Dim sNomFeuille As String,sNomDossier As String
Dim Nb As Long,iMois As Integer, j As Integer
Dim NbJMois As Integer,iYear As Integer
Dim bLike As Boolean
....
NumLigneFichier = 4: Nb = 4
For i = 1 To NbFichiers
NomFichier = ShImport.Range("A" & NumLigneFichier)
bLike = UCase(NomFichier) Like UCase(FichierRch)
If bLike Then
iMois = CInt(Mid(NomFichier, 5, 2)): iYear = CInt(Left(NomFichier, 4))
NbJMois = NbJoursDuMois(iMois, iYear)
With ShImport
For j = 1 To NbJMois
sNomFeuille = NomFeuilleRch(j, iMois)
sNomDossier = BackSlashDossier(ShImport.Range("B" & NumLigneFichier))
.Cells(Nb, 3) = ExtraireValeur(sNomDossier, NomFichier, sNomFeuille, "A1" )
Nb = Nb + 1
Next j
End With
NumLigneFichier = NumLigneFichier + 1
End If
Application.StatusBar = i & " / " & NbFichiers
Next i
EffacerLignes_REF_Vides
.....
|